Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bbf89a45
由
张东亮
编写于
2023-03-23 09:46:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
03cb63d7
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
143 行增加
和
120 行删除
DeviceLibrary/Config/CameraA.json
DeviceLibrary/DeviceLibrary/IPCameraHelper.cs
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_ServerControl.cs
DeviceLibrary/theMachine/MainMachine_String.cs
DeviceLibrary/theMachine/RobotManage.cs
TheMachine/Form1.cs
TheMachine/SettingControl.Designer.cs
TheMachine/SettingControl.cs
DeviceLibrary/Config/CameraA.json
查看文件 @
bbf89a4
{
"HIKIPCamera"
:
[
{
"Name"
:
"
monitorA
"
,
"IP"
:
"192.168.10
6.21
"
,
"Name"
:
"
cam1
"
,
"IP"
:
"192.168.10
5.25
"
,
"User"
:
"admin"
,
"Password"
:
"Acc123456"
,
"Port"
:
8000
...
...
DeviceLibrary/DeviceLibrary/IPCameraHelper.cs
查看文件 @
bbf89a4
...
...
@@ -35,17 +35,24 @@ namespace DeviceLibrary
}
}
static
string
baseDir
=
ConfigHelper
.
Config
.
Get
(
"IPCameraService_HttpServer"
,
"http://localhost:8088"
);
static
string
cameName
=
ConfigHelper
.
Config
.
Get
(
"IPCameraService_CamName"
,
"cam1"
);
public
static
void
StartRecord
(
string
fileName
=
""
)
{
string
url
=
$
"{baseDir}/cam/startRecord?camName=cam1&filename={fileName}"
;
string
res
=
HttpHelper
.
Get
(
url
);
LogUtil
.
info
(
$
"开始记录视频:{fileName},{res}"
);
Task
.
Factory
.
StartNew
(
delegate
{
string
url
=
$
"{baseDir}/cam/startRecord?camName={cameName}&filename={fileName}"
;
string
res
=
HttpHelper
.
Get
(
url
);
LogUtil
.
info
(
$
"开始记录视频:{fileName},{res}"
);
});
}
public
static
void
StopRecord
()
{
string
url
=
$
"{baseDir}/cam/stopRecord?camName=cam1"
;
string
res
=
HttpHelper
.
Get
(
url
);
LogUtil
.
info
(
$
"停止记录视频:{res}"
);
Task
.
Factory
.
StartNew
(
delegate
{
string
url
=
$
"{baseDir}/cam/stopRecord?camName={cameName}"
;
string
res
=
HttpHelper
.
Get
(
url
);
LogUtil
.
info
(
$
"停止记录视频:{res}"
);
});
}
//判断服务是否存在
static
bool
IsServiceExisted
(
string
serviceName
)
...
...
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
bbf89a4
...
...
@@ -40,6 +40,10 @@ namespace DeviceLibrary
}
SafetyDevice
.
AddDevice
(
this
);
}
public
void
ClearAlarm
()
{
}
public
bool
isAtTOP
{
get
{
return
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
);
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
bbf89a4
...
...
@@ -20,7 +20,8 @@ namespace DeviceLibrary
get
{
return
_canRunning
;
}
set
{
if
(
_canRunning
!=
value
)
{
if
(
_canRunning
!=
value
)
{
Msg
.
setlogones
();
}
_canRunning
=
value
;
...
...
@@ -76,11 +77,12 @@ namespace DeviceLibrary
public
MainMachine
(
Robot_Config
_config
)
{
public
MainMachine
(
Robot_Config
_config
)
{
Config
=
_config
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
StringMoveInfo
=
new
MoveInfo
(
$
"料串进出机构"
);
StringMoveInfo
.
SetStateDelegate
(
StringProcessState
);
StringMoveInfo
.
SetStateDelegate
(
StringProcessState
);
ClampMoveInfo
=
new
MoveInfo
(
$
"取放料机构"
);
ClampMoveInfo
.
SetStateDelegate
(
ClampState
);
StoreMoveInfo
=
new
MoveInfo
(
$
"进出库调度"
);
...
...
@@ -106,7 +108,7 @@ namespace DeviceLibrary
Clamp_Axis
.
interference
+=
Clamp_Axis_interference
;
Crc_LanguageChangeEvent
(
null
,
EventArgs
.
Empty
);
#
endregion
Line
=
new
LineRunMonitor
(
$
"料串进出机构"
,
Config
.
DOList
[
IO_Type
.
LineRun
].
GetIOAddr
(),
Config
.
DOList
[
IO_Type
.
LineRev
].
GetIOAddr
());
Line
=
new
LineRunMonitor
(
$
"料串进出机构"
,
Config
.
DOList
[
IO_Type
.
LineRun
].
GetIOAddr
(),
Config
.
DOList
[
IO_Type
.
LineRev
].
GetIOAddr
());
SingleDoor
=
new
CylinderManger
(
$
"单料门"
,
IO_Type
.
NGDoor_Open
,
IO_Type
.
NGDoor_Close
);
//检测翻板门是否为鸣志点击伺服控制
if
(
Config
.
FlipDoor_L_Axis
==
null
&&
Config
.
FlipDoor_R_Axis
==
null
)
...
...
@@ -122,11 +124,12 @@ namespace DeviceLibrary
{
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
ReelFlipDoor_Work
);
RobotManage
.
Config
.
DOList
.
Remove
(
IO_Type
.
ReelFlipDoor_Home
);
MotorFlipDoorB
=
new
LiftMonitor
(
IO_Type
.
ReelFlipDoor_L_Home
,
IO_Type
.
ReelFlipDoor_L_Work
,
IO_Type
.
SafetyLightCurtains
,
null
,
new
AxisBean
(
Config
.
FlipDoor_L_Axis
,
Name
),
Config
.
FlipDoorLength
,
Config
.
FlipDoorLength_speed
);
MotorFlipDoorB
=
new
LiftMonitor
(
IO_Type
.
ReelFlipDoor_L_Home
,
IO_Type
.
ReelFlipDoor_L_Work
,
IO_Type
.
SafetyLightCurtains
,
null
,
new
AxisBean
(
Config
.
FlipDoor_L_Axis
,
Name
),
Config
.
FlipDoorLength
,
Config
.
FlipDoorLength_speed
);
MotorFlipDoorA
=
new
LiftMonitor
(
IO_Type
.
ReelFlipDoor_R_Home
,
IO_Type
.
ReelFlipDoor_R_Work
,
IO_Type
.
SafetyLightCurtains
,
null
,
new
AxisBean
(
Config
.
FlipDoor_R_Axis
,
Name
),
Config
.
FlipDoorLength
,
Config
.
FlipDoorLength_speed
);
LogUtil
.
info
(
"加载翻板门类型为:步进"
);
}
else
{
else
{
throw
new
Exception
(
"料仓翻板门配置错误"
);
}
...
...
@@ -147,7 +150,8 @@ namespace DeviceLibrary
else
LogUtil
.
info
(
"加载料串门类型为:气缸"
);
if
(
ConfigHelper
.
Config
.
Get
(
"Device_Disable_DoorSafeCheck"
,
false
))
{
if
(
ConfigHelper
.
Config
.
Get
(
"Device_Disable_DoorSafeCheck"
,
false
))
{
RobotManage
.
Config
.
DIList
.
Remove
(
IO_Type
.
LeftDoorClose_Check
);
RobotManage
.
Config
.
DIList
.
Remove
(
IO_Type
.
RightDoorClose_Check
);
...
...
@@ -177,11 +181,11 @@ namespace DeviceLibrary
//BoxTransport_InOutEndProcessEvent;
//ProcessMsgEvent += MainMachine_ProcessMsgEvent;
ConfigHelper
.
Config
.
Get
(
"Device_Disable_StringDoor"
,
false
);
AlarmBuzzer
.
SetOnOffAction
(()
=>{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
AlarmBuzzer
.
SetOnOffAction
(()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
HIGH
);
},
()
=>
{
IOMove
(
IO_Type
.
Alarm_Buzzer
,
IO_VALUE
.
LOW
);
});
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
Reset_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
AutoRun_Single
,
Config
,
IO_VALUE
.
HIGH
,
Run_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
SafetyLightCurtains
,
Config
,
IO_VALUE
.
LOW
,
DeviceSuddenStop
,
1
,
1
);
IOMonitor
.
RegisterIO
(
IO_Type
.
Reset_BTN
,
Config
,
IO_VALUE
.
HIGH
,
Reset_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
AutoRun_Single
,
Config
,
IO_VALUE
.
HIGH
,
Run_BTN
,
2500
,
100
);
IOMonitor
.
RegisterIO
(
IO_Type
.
SafetyLightCurtains
,
Config
,
IO_VALUE
.
LOW
,
DeviceSuddenStop
,
1
,
1
);
LedProcessInit
();
ConfigHelper
.
Config
.
Get
(
"CamTestReel_Ability"
,
false
);
ConfigHelper
.
Config
.
Set
(
"CamTestReel_debug"
,
false
);
...
...
@@ -191,7 +195,7 @@ namespace DeviceLibrary
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
{
StringMoveInfo
.
Name
=
crc
.
GetString
(
L
.
string_inout_equipment
,
"料串进出机构"
);
StringMoveInfo
.
Name
=
crc
.
GetString
(
L
.
string_inout_equipment
,
"料串进出机构"
);
ClampMoveInfo
.
Name
=
crc
.
GetString
(
L
.
clamp_equipment
,
"取放料机构"
);
StoreMoveInfo
.
Name
=
crc
.
GetString
(
L
.
store_manage_equipment
,
"进出库调度"
);
ResetMoveInfo
.
Name
=
crc
.
GetString
(
L
.
reset_equipment
,
"重置"
);
...
...
@@ -214,12 +218,12 @@ namespace DeviceLibrary
return
(
true
,
crc
.
GetString
(
L
.
Clamp_Axis_interference_02
,
"上料定位臂不在避让端,不允许下降取料轴"
));
}
else
if
(
to
>=
Config
.
Clamp_P3
)
{
if
(
IOValue
(
IO_Type
.
ReelFlipDoor_L_Home
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
ReelFlipDoor_R_Home
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(
IOValue
(
IO_Type
.
ReelFlipDoor_L_Home
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
ReelFlipDoor_R_Home
).
Equals
(
IO_VALUE
.
HIGH
))
return
(
false
,
""
);
else
return
(
true
,
crc
.
GetString
(
L
.
Clamp_Axis_interference_03
,
"翻板门不在垂直端,不允许下降取料轴"
));
}
}
return
(
false
,
""
);
}
...
...
@@ -249,10 +253,12 @@ namespace DeviceLibrary
/// <summary>
/// 整机启动变量,设置为false后将退出线程,只在停止时调用
/// </summary>
bool
mstart
=
true
;
public
void
Run
()
{
bool
mstart
=
true
;
public
void
Run
()
{
mstart
=
true
;
while
(
mstart
)
{
while
(
mstart
)
{
try
{
canRunning
=
DeviceCheck
();
...
...
@@ -287,11 +293,12 @@ namespace DeviceLibrary
Msg
.
add
(
ex
.
ToString
(),
MsgLevel
.
warning
);
Msg
.
setlogones
();
}
finally
{
finally
{
var
m
=
Msg
.
get
();
ProcessMsgEvent
?.
Invoke
(
m
);
ServerCM
.
ProcessMsg
(
m
);
StoreStatus
currnetstoreStatus
=
StoreStatus
.
None
;
StoreStatus
currnetstoreStatus
=
StoreStatus
.
None
;
if
(
m
.
Find
((
aa
)
=>
aa
.
msgLevel
==
MsgLevel
.
alarm
)
==
null
)
{
hasAlarm
=
false
;
...
...
@@ -304,7 +311,8 @@ namespace DeviceLibrary
currnetstoreStatus
=
StoreStatus
.
StoreOnline
;
}
}
else
{
else
{
hasAlarm
=
true
;
AlarmBuzzer
.
ON
();
currnetstoreStatus
=
isInSuddenDown
?
StoreStatus
.
SuddenStop
:
StoreStatus
.
Warning
;
...
...
@@ -315,18 +323,20 @@ namespace DeviceLibrary
//else
// currnetstoreStatus = StoreStatus.Debugging;
if
(
currnetstoreStatus
!=
StoreStatus
.
None
)
if
(
currnetstoreStatus
!=
StoreStatus
.
None
)
ServerCM
.
storeStatus
=
currnetstoreStatus
;
}
}
IPCameraHelper
.
StopRecord
();
LogUtil
.
info
(
"主线程已退出."
);
}
public
void
Start
()
{
public
void
Start
()
{
ServerCM
.
StartConnectServer
();
Run
();
}
public
void
Stop
()
{
public
void
Stop
()
{
LogUtil
.
info
(
"开始停止系统2."
);
mstart
=
false
;
AutoInOutTest
=
false
;
...
...
@@ -339,13 +349,15 @@ namespace DeviceLibrary
}
public
void
BeginHomeReset
(
bool
firstRun
=
false
)
{
public
void
BeginHomeReset
(
bool
firstRun
=
false
)
{
if
(!
firstRun
)
{
StopMove
();
Thread
.
Sleep
(
500
);
}
OpenAllServo
();
AxisBean
.
List
.
ForEach
((
x
)
=>
{
AxisManager
.
AlarmClear
(
x
.
Config
.
DeviceName
,
x
.
Config
.
GetAxisValue
());
});
Alarm
(
AlarmType
.
None
);
runStatus
=
RunStatus
.
HomeReset
;
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
...
...
@@ -353,7 +365,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
}
//强制回原
bool
forceHome
=
true
;
bool
forceHome
=
true
;
void
HomeReset
()
{
if
(
CheckWait
(
ResetMoveInfo
))
...
...
@@ -362,16 +374,22 @@ namespace DeviceLibrary
switch
(
ResetMoveInfo
.
MoveStep
)
{
case
MoveStep
.
H01_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset_01
);
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H02_HomeReset_01
);
ServerCM
.
storeStatus
=
StoreStatus
.
ResetMove
;
if
(
IOValue
(
IO_Type
.
StringBack_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
LOW
)){
if
(
IOValue
(
IO_Type
.
StringBack_Check
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
ResetMoveInfo
.
log
(
"复位时没有料串"
);
}
else
if
(
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
crc
.
GetString
(
L
.
string_not_onposition
,
"回原时X09,X10信号异常,料串可能不在正确位置,请检查."
),
MsgLevel
.
alarm
);
//0429
RobotManage
.
UserPause
(
$
"回原时X09,X10信号异常,料串可能不在正确位置,请检查"
);
return
;
else
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_IO_X08IsStringDoor_SafetyLightCurtains"
,
false
))
{
if
(
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
crc
.
GetString
(
L
.
string_not_onposition
,
"回原时X09,X10信号异常,料串可能不在正确位置,请检查."
),
MsgLevel
.
alarm
);
//0429
RobotManage
.
UserPause
(
$
"回原时X09,X10信号异常,料串可能不在正确位置,请检查"
);
return
;
}
}
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_Disable_StringDoor"
,
false
))
StringDoorClose
(
null
);
break
;
...
...
@@ -389,7 +407,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
log
(
"夹爪轴回原"
);
Clamp_Axis
.
HomeMove
(
ResetMoveInfo
,
forceHome
);
break
;
case
MoveStep
.
H03_HomeReset
:
case
MoveStep
.
H03_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
ResetMoveInfo
.
log
(
"旋转轴,升降轴,回原,料叉P1待机点"
);
InOut_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
InOut_P1
,
Config
.
InOut_P1_speed
);
...
...
@@ -418,7 +436,7 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
H07_HomeReset
:
if
(
GetWidth
()
>
0
)
if
(
GetWidth
()
>
0
)
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
ResetMoveInfo
.
log
(
"夹爪上有料盘,送到NG口"
);
...
...
@@ -442,7 +460,7 @@ namespace DeviceLibrary
case
MoveStep
.
H09_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H10_HomeReset
);
ResetMoveInfo
.
log
(
"夹爪轴下降到NG托盘位置 p3"
);
Clamp_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Clamp_P3
-
50
*
Config
.
Clamp_PoToMM
,
Config
.
Clamp_P3_speed
);
Clamp_Axis
.
AbsMove
(
ResetMoveInfo
,
Config
.
Clamp_P3
-
50
*
Config
.
Clamp_PoToMM
,
Config
.
Clamp_P3_speed
);
break
;
case
MoveStep
.
H10_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H11_HomeReset
);
...
...
@@ -465,7 +483,7 @@ namespace DeviceLibrary
if
(!
NGDoor_Tray_Test_Reel
)
{
Msg
.
add
(
crc
.
GetString
(
L
.
x29_low_no_reel
,
"传感器未检测到单料口料盘."
),
MsgLevel
.
alarm
);
RobotManage
.
UserPause
(
crc
.
GetString
(
"x29_low_no_reel"
,
"传感器未检测到单料口料盘."
));
RobotManage
.
UserPause
(
crc
.
GetString
(
"x29_low_no_reel"
,
"传感器未检测到单料口料盘."
));
}
//CylinderMove(ResetMoveInfo, IO_Type.NGDoor_Close, IO_Type.NGDoor_Open, IO_VALUE.HIGH);
SingleDoor
.
ToHigh
(
ResetMoveInfo
);
...
...
@@ -484,9 +502,10 @@ namespace DeviceLibrary
else
{
RobotManage
.
UserPause
(
$
"系统启动检测到有无信息料盘,等待取走单料口料盘"
);
}
}
}
else
{
else
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H15_HomeReset
);
ResetMoveInfo
.
log
(
"料盘已取走"
);
}
...
...
@@ -496,7 +515,7 @@ namespace DeviceLibrary
{
Msg
.
add
(
crc
.
GetString
(
L
.
wait_put_reel_into_ngdoor
,
"等待阻挡物离开光栅"
),
MsgLevel
.
warning
);
}
else
else
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H16_HomeReset
);
}
...
...
@@ -542,8 +561,8 @@ namespace DeviceLibrary
ServerCM
.
storeStatus
=
StoreStatus
.
OutStoreExecute
;
CloseFlipDoor
(
StoreMoveInfo
);
}
else
if
((
RobotManage
.
HasReelInFixPos
(
out
ReelParam
reelParam
))
&&
boxTransport
.
IsComplateOrFree
else
if
((
RobotManage
.
HasReelInFixPos
(
out
ReelParam
reelParam
))
&&
boxTransport
.
IsComplateOrFree
&&
ClampMoveInfo
.
MoveStep
==
MoveStep
.
Wait
&&
ConfigHelper
.
Config
.
Get
(
"Device_Use_Fixpos"
,
false
)
&&
IOValue
(
IO_Type
.
TrayCheck_Fixture
).
Equals
(
IO_VALUE
.
LOW
))
{
...
...
@@ -559,19 +578,25 @@ namespace DeviceLibrary
}
}
//bool _IgnoreSafecheck = false;
public
bool
IgnoreSafecheck
{
get
=>
IOValue
(
IO_Type
.
DoorSafe_Disable
).
Equals
(
IO_VALUE
.
HIGH
);
set
{
public
bool
IgnoreSafecheck
{
get
=>
IOValue
(
IO_Type
.
DoorSafe_Disable
).
Equals
(
IO_VALUE
.
HIGH
);
set
{
if
(
value
)
{
IOMove
(
IO_Type
.
DoorSafe_Disable
,
IO_VALUE
.
HIGH
);
}
else
{
else
{
IOMove
(
IO_Type
.
DoorSafe_Disable
,
IO_VALUE
.
LOW
);
}
}
}
}
}
public
bool
IgnoreGratingSignal
=
false
;
bool
lastSafeCheckStatus
=
true
;
bool
SafeCheck
()
{
bool
SafeCheck
()
{
bool
ok
=
true
;
var
ignorestring
=
"["
+
crc
.
GetString
(
L
.
ignored
,
"已忽略"
)
+
"]"
;
//if (IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.LOW))
...
...
@@ -635,7 +660,8 @@ namespace DeviceLibrary
return
ok
;
}
void
DeviceSuddenStop
()
{
void
DeviceSuddenStop
()
{
if
(
lastSafeCheckStatus
)
{
AxisBean
.
StopMultiAxis
(
AxisBean
.
List
);
...
...
@@ -654,15 +680,18 @@ namespace DeviceLibrary
DateTime
lastAirCloseTime
=
DateTime
.
MinValue
;
internal
DateTime
checkAlarmTime
=
DateTime
.
Now
;
bool
SafetyLightStop
{
get
{
bool
SafetyLightStop
{
get
{
if
(
RobotManage
.
Config
.
DOList
.
ContainsKey
(
IO_Type
.
DoorSafe_Disable
))
return
IOValue
(
IO_Type
.
DoorSafe_Disable
).
Equals
(
IO_VALUE
.
LOW
)
&&
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
);
else
return
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
);
}
}
public
bool
DeviceCheck
()
{
public
bool
DeviceCheck
()
{
bool
ok
=
true
;
isInSuddenDown
=
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
);
if
(
SafetyLightStop
)
...
...
@@ -688,14 +717,15 @@ namespace DeviceLibrary
lastSafeCheckStatus
=
false
;
ok
=
false
;
}
else
if
(
alarmType
!=
AlarmType
.
None
)
{
else
if
(
alarmType
!=
AlarmType
.
None
)
{
//if (IOValue(IO_Type.Right_BTN).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.Left_BTN).Equals(IO_VALUE.HIGH))
//{
// Alarm(AlarmType.None);
//}
//else
{
Msg
.
add
(
crc
.
GetString
(
L
.
system_need_reset
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
L
.
system_need_reset
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
}
}
...
...
@@ -716,11 +746,12 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
L
.
airpressure_not_enough
,
"气压不足"
),
MsgLevel
.
warning
);
}
}
else
{
else
{
lastAirCloseTime
=
DateTime
.
MinValue
;
}
if
(
alarmType
!=
AlarmType
.
SuddenStop
)
if
(
alarmType
!=
AlarmType
.
SuddenStop
)
{
TimeSpan
span
=
DateTime
.
Now
-
checkAlarmTime
;
if
(
span
.
TotalSeconds
>
2
)
...
...
@@ -736,7 +767,7 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
+
crc
.
GetString
(
L
.
motion_alarm
,
"运动报警"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
}
}
LogUtil
.
error
(
string
.
Join
(
","
,
HuichuanLibrary
.
HCBoardManager
.
GetAxisErrorDetail
(
configMoveAxis
.
GetAxisValue
())));
}
}
...
...
@@ -745,7 +776,8 @@ namespace DeviceLibrary
return
ok
;
}
public
void
IgnoreX09
()
{
public
void
IgnoreX09
()
{
boxTransport
.
IgnoreX09
=
true
;
LogUtil
.
info
(
"按下X09忽略"
);
}
...
...
DeviceLibrary/theMachine/MainMachine_ServerControl.cs
查看文件 @
bbf89a4
...
...
@@ -85,12 +85,16 @@ namespace DeviceLibrary
public
string
doCloseBatchDoor
()
{
LogUtil
.
info
(
"请求关闭批量料门"
);
if
(
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
HIGH
))
if
(
!
ConfigHelper
.
Config
.
Get
(
"Device_IO_X08IsStringDoor_SafetyLightCurtains"
,
false
))
{
LogUtil
.
info
(
"料串尚未到位无法关门X09=High"
);
return
crc
.
GetString
(
L
.
string_not_onposition_01
,
"料串尚未到位无法关门X09=High"
);
if
(
IOValue
(
IO_Type
.
StringFront_Check
).
Equals
(
IO_VALUE
.
HIGH
))
{
LogUtil
.
info
(
"料串尚未到位无法关门X09=High"
);
return
crc
.
GetString
(
L
.
string_not_onposition_01
,
"料串尚未到位无法关门X09=High"
);
}
}
//RobotManage.mainMachine.StringMoveInfo.NewMove(MoveStep.Wait);
//RobotManage.mainMachine.StringMoveInfo.NextMoveStep(RobotManage.mainMachine.StringMoveInfo.MoveStep);
StringMoveInfo
.
LastSetpTime
=
DateTime
.
Now
;
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
bbf89a4
...
...
@@ -138,6 +138,7 @@ namespace DeviceLibrary
// StringDoorClose(StringMoveInfo);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringFix_Bottom
,
IO_Type
.
StringFix_Top
,
IO_VALUE
.
HIGH
);
CylinderMove
(
StringMoveInfo
,
IO_Type
.
StringPosChecker_Home
,
IO_Type
.
StringPosChecker_Work
,
IO_VALUE
.
HIGH
);
Line
.
LineStop
(
"n"
);
}
else
{
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
bbf89a4
...
...
@@ -79,6 +79,7 @@ namespace DeviceLibrary
IsLoadOk
=
false
;
msg
+=
crc
.
GetString
(
L
.
iocard_init_fail
,
"IO板卡初始化失败"
)+
"\n"
;
}
// IOManager.CloseAllConnection();
if
(!
CameraA
.
LoadCameraConfig
(
"CameraA"
,
out
string
errmsg
))
{
IsLoadOk
=
false
;
...
...
@@ -88,6 +89,12 @@ namespace DeviceLibrary
IsLoadOk
=
false
;
msg
+=
crc
.
GetString
(
L
.
tempnhum_sensor_init_fail
,
$
"温湿度传感器初始化失败,端口:"
)+
$
"{ConfigHelper.Config.Get("
Device_Humiture_Port
")}\n"
;
}
//Thread.Sleep(1000);
//if (!IOManager.ConnectionIOList(new List<string>()))
//{
// IsLoadOk = false;
// msg += crc.GetString(L.iocard_init_fail, "IO板卡初始化失败") + "\n";
//}
IOManager
.
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Camera_Led
,
IO_VALUE
.
HIGH
);
...
...
@@ -124,8 +131,6 @@ namespace DeviceLibrary
GC
.
KeepAlive
(
mainThread
);
Task
.
Run
(()=>
{
AxisBean
.
List
.
ForEach
((
x
)
=>
{
AxisManager
.
AlarmClear
(
x
.
Config
.
DeviceName
,
x
.
Config
.
GetAxisValue
());
});
Task
.
Delay
(
1000
).
Wait
();
if
(
mainMachine
.
DeviceCheck
())
mainMachine
.
BeginHomeReset
(
true
);
...
...
TheMachine/Form1.cs
查看文件 @
bbf89a4
...
...
@@ -142,6 +142,7 @@ namespace TheMachine
// Thread.Sleep(100);
// Application.DoEvents();
//}
this
.
DoubleBuffered
=
true
;
pnl
.
Enabled
=
false
;
}
...
...
@@ -151,6 +152,7 @@ namespace TheMachine
{
pictureBox1
.
Visible
=
true
;
pictureBox1
.
Image
=
e
;
Application
.
DoEvents
();
},
sender
,
e
);
}
private
void
CameraB_camera_event
(
object
sender
,
Bitmap
e
)
...
...
TheMachine/SettingControl.Designer.cs
查看文件 @
bbf89a4
...
...
@@ -40,8 +40,6 @@ namespace TheMachine
this
.
cb_usefixpos
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
button1
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
uC_SetUserPassword1
=
new
TheMachine
.
UC_SetUserPassword
();
this
.
button2
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
tp
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -49,10 +47,10 @@ namespace TheMachine
//
this
.
chbAutoRun
.
AutoSize
=
true
;
this
.
tp
.
SetColumnSpan
(
this
.
chbAutoRun
,
2
);
this
.
chbAutoRun
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
175
);
this
.
chbAutoRun
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
214
);
this
.
chbAutoRun
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
chbAutoRun
.
Name
=
"chbAutoRun"
;
this
.
chbAutoRun
.
Size
=
new
System
.
Drawing
.
Size
(
1
04
,
19
);
this
.
chbAutoRun
.
Size
=
new
System
.
Drawing
.
Size
(
1
74
,
32
);
this
.
chbAutoRun
.
TabIndex
=
1
;
this
.
chbAutoRun
.
Text
=
"开机自启动"
;
this
.
chbAutoRun
.
UseVisualStyleBackColor
=
true
;
...
...
@@ -61,10 +59,10 @@ namespace TheMachine
//
this
.
cb_tempsensorport
.
DropDownStyle
=
System
.
Windows
.
Forms
.
ComboBoxStyle
.
DropDownList
;
this
.
cb_tempsensorport
.
FormattingEnabled
=
true
;
this
.
cb_tempsensorport
.
Location
=
new
System
.
Drawing
.
Point
(
161
,
6
);
this
.
cb_tempsensorport
.
Location
=
new
System
.
Drawing
.
Point
(
276
,
6
);
this
.
cb_tempsensorport
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
6
);
this
.
cb_tempsensorport
.
Name
=
"cb_tempsensorport"
;
this
.
cb_tempsensorport
.
Size
=
new
System
.
Drawing
.
Size
(
121
,
23
);
this
.
cb_tempsensorport
.
Size
=
new
System
.
Drawing
.
Size
(
121
,
35
);
this
.
cb_tempsensorport
.
TabIndex
=
2
;
this
.
cb_tempsensorport
.
Tag
=
"not"
;
//
...
...
@@ -75,7 +73,7 @@ namespace TheMachine
this
.
label_tempsensor
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
10
);
this
.
label_tempsensor
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
label_tempsensor
.
Name
=
"label_tempsensor"
;
this
.
label_tempsensor
.
Size
=
new
System
.
Drawing
.
Size
(
135
,
15
);
this
.
label_tempsensor
.
Size
=
new
System
.
Drawing
.
Size
(
250
,
28
);
this
.
label_tempsensor
.
TabIndex
=
3
;
this
.
label_tempsensor
.
Text
=
"温湿度控制器端口:"
;
this
.
label_tempsensor
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
TopRight
;
...
...
@@ -83,7 +81,7 @@ namespace TheMachine
// button_positiontool
//
this
.
tp
.
SetColumnSpan
(
this
.
button_positiontool
,
2
);
this
.
button_positiontool
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
80
);
this
.
button_positiontool
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
106
);
this
.
button_positiontool
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
button_positiontool
.
Name
=
"button_positiontool"
;
this
.
button_positiontool
.
Size
=
new
System
.
Drawing
.
Size
(
181
,
36
);
...
...
@@ -96,10 +94,10 @@ namespace TheMachine
//
this
.
lbl_hmdstate
.
AutoSize
=
true
;
this
.
tp
.
SetColumnSpan
(
this
.
lbl_hmdstate
,
2
);
this
.
lbl_hmdstate
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
45
);
this
.
lbl_hmdstate
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
58
);
this
.
lbl_hmdstate
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
lbl_hmdstate
.
Name
=
"lbl_hmdstate"
;
this
.
lbl_hmdstate
.
Size
=
new
System
.
Drawing
.
Size
(
67
,
15
);
this
.
lbl_hmdstate
.
Size
=
new
System
.
Drawing
.
Size
(
124
,
28
);
this
.
lbl_hmdstate
.
TabIndex
=
5
;
this
.
lbl_hmdstate
.
Tag
=
"not"
;
this
.
lbl_hmdstate
.
Text
=
"当前状态"
;
...
...
@@ -134,21 +132,20 @@ namespace TheMachine
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
());
this
.
tp
.
Size
=
new
System
.
Drawing
.
Size
(
310
,
204
);
this
.
tp
.
Size
=
new
System
.
Drawing
.
Size
(
540
,
256
);
this
.
tp
.
TabIndex
=
6
;
//
// cb_usefixpos
//
this
.
cb_usefixpos
.
AutoSize
=
true
;
this
.
tp
.
SetColumnSpan
(
this
.
cb_usefixpos
,
2
);
this
.
cb_usefixpos
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
1
36
);
this
.
cb_usefixpos
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
1
62
);
this
.
cb_usefixpos
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
10
);
this
.
cb_usefixpos
.
Name
=
"cb_usefixpos"
;
this
.
cb_usefixpos
.
Size
=
new
System
.
Drawing
.
Size
(
119
,
19
);
this
.
cb_usefixpos
.
Size
=
new
System
.
Drawing
.
Size
(
202
,
32
);
this
.
cb_usefixpos
.
TabIndex
=
6
;
this
.
cb_usefixpos
.
Text
=
"启用校准库位"
;
this
.
cb_usefixpos
.
UseVisualStyleBackColor
=
true
;
this
.
cb_usefixpos
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_usefixpos_CheckedChanged
);
//
// button1
//
...
...
@@ -170,31 +167,9 @@ namespace TheMachine
this
.
uC_SetUserPassword1
.
Size
=
new
System
.
Drawing
.
Size
(
405
,
272
);
this
.
uC_SetUserPassword1
.
TabIndex
=
8
;
//
// button2
//
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
50
,
325
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
144
,
41
);
this
.
button2
.
TabIndex
=
9
;
this
.
button2
.
Text
=
"Start Recording"
;
this
.
button2
.
UseVisualStyleBackColor
=
true
;
this
.
button2
.
Click
+=
new
System
.
EventHandler
(
this
.
button2_Click
);
//
// button3
//
this
.
button3
.
Location
=
new
System
.
Drawing
.
Point
(
50
,
403
);
this
.
button3
.
Name
=
"button3"
;
this
.
button3
.
Size
=
new
System
.
Drawing
.
Size
(
144
,
41
);
this
.
button3
.
TabIndex
=
10
;
this
.
button3
.
Text
=
"Stop Recording"
;
this
.
button3
.
UseVisualStyleBackColor
=
true
;
this
.
button3
.
Click
+=
new
System
.
EventHandler
(
this
.
button3_Click
);
//
// SettingControl
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
Controls
.
Add
(
this
.
button3
);
this
.
Controls
.
Add
(
this
.
button2
);
this
.
Controls
.
Add
(
this
.
uC_SetUserPassword1
);
this
.
Controls
.
Add
(
this
.
button1
);
this
.
Controls
.
Add
(
this
.
tp
);
...
...
@@ -219,7 +194,5 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
CheckBox
cb_usefixpos
;
private
System
.
Windows
.
Forms
.
Button
button1
;
private
UC_SetUserPassword
uC_SetUserPassword1
;
private
System
.
Windows
.
Forms
.
Button
button2
;
private
System
.
Windows
.
Forms
.
Button
button3
;
}
}
TheMachine/SettingControl.cs
查看文件 @
bbf89a4
...
...
@@ -133,19 +133,14 @@ namespace TheMachine
Task
.
Run
(()=>
CodeManager
.
TestHasReel
(
CodeManager
.
hikNameList
[
0
]));
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
DeviceLibrary
.
IPCameraHelper
.
StartRecord
(
"manual"
);
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
DeviceLibrary
.
IPCameraHelper
.
StopRecord
();
}
private
void
cb_usefixpos_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
}
//private void button2_Click(object sender, EventArgs e)
//{
// DeviceLibrary.IPCameraHelper.StartRecord("manual");
//}
//private void button3_Click(object sender, EventArgs e)
//{
// DeviceLibrary.IPCameraHelper.StopRecord();
//}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论