Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1053_CycleLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bd6dcba0
由
刘韬
编写于
2022-08-19 10:21:46 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
79ba11eb
全部展开
显示空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
163 行增加
和
297 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/theMachine/DeviceBase.cs
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MoveStep.cs
DeviceLibrary/theMachine/RobotManage.cs
DeviceLibrary/theMachine/sub/IDevice.cs
DeviceLibrary/theMachine/sub/SideMove.cs
DeviceLibrary/theMachine/sub/TransplantMove.cs
DeviceLibrary/theMachine/sub/TrayStop.cs
LoadCVSLibrary/Config/Config.csv
LoadCVSLibrary/Config/DeviceGroup.csv
LoadCVSLibrary/position/DeviceGroup.cs
TheMachine/Form1.Designer.cs
TheMachine/Form1.cs
TheMachine/SettingControl.cs
TheMachine/device/HYControl.cs
Common/Setting_Init.cs
查看文件 @
bd6dcba
...
...
@@ -17,7 +17,7 @@ namespace OnlineStore.Common
/// 系统主界面标题
/// </summary>
[
MyConfigComment
(
"系统主界面标题"
)]
public
static
MyConfig
<
string
>
App_Title
=
"
MIMO
"
;
public
static
MyConfig
<
string
>
App_Title
=
"
Cycle Line
"
;
[
MyConfigComment
(
"服务器地址"
)]
public
static
MyConfig
<
string
>
Device_Server_Address
=
"http://192.168.1.243/smf-core"
;
...
...
@@ -31,35 +31,8 @@ namespace OnlineStore.Common
[
MyConfigComment
(
"是否启用蜂鸣器"
)]
public
static
MyConfig
<
bool
>
Device_EnableBuzzer
=
true
;
[
MyConfigComment
(
"温湿度传感器串口号"
)]
public
static
MyConfig
<
string
>
Device_Humiture_Port
=
"COM3"
;
[
MyConfigComment
(
"是否启用校准库位"
)]
public
static
MyConfig
<
bool
>
Device_Use_Fixpos
=
false
;
[
MyConfigComment
(
"屏蔽日志窗口"
)]
public
static
MyConfig
<
bool
>
Device_DisableLogWindow
=
true
;
[
MyConfigComment
(
"屏蔽升降轴调试保护"
)]
public
static
MyConfig
<
bool
>
Device_DisableUpdownProtect
=
false
;
[
MyConfigComment
(
"湿度超限吹气启动相对值=服务器设定湿度报警值-本相对值"
)]
public
static
MyConfig
<
int
>
Device_HumidityStartOffser
=
1
;
[
MyConfigComment
(
"湿度超限吹气停止相对值=服务器设定湿度报警值-本相对值"
)]
public
static
MyConfig
<
int
>
Device_HumidityEndOffser
=
10
;
[
MyConfigComment
(
"单料口入库只能单料口出"
)]
public
static
MyConfig
<
bool
>
Device_SingleInSingleOut
=
false
;
[
MyConfigComment
(
"允许单料口单盘入库"
)]
public
static
MyConfig
<
bool
>
Device_Allow_SingleIn
=
false
;
[
MyConfigComment
(
"是否启用socket扫码"
)]
public
static
MyConfig
<
bool
>
SocketScanner_enable
=
false
;
[
MyConfigComment
(
"socket uri=socket://127.0.0.1:7930"
)]
public
static
MyConfig
<
string
>
SocketScanner_uri
=
"socket://127.0.0.1:7930"
;
[
MyConfigComment
(
"socket 扫码等待超时"
)]
public
static
MyConfig
<
int
>
SocketScanner_receiver_timeout
=
10000
;
[
MyConfigComment
(
"socket 扫码触发代码"
)]
public
static
MyConfig
<
string
>
SocketScanner_trigger_code
=
"trigger"
;
[
MyConfigComment
(
"socket 扫码接收匹配正则表达式"
)]
public
static
MyConfig
<
string
>
SocketScanner_pattern_code
=
"reel:(.+?)!"
;
/// <summary>
...
...
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
bd6dcba
...
...
@@ -83,15 +83,6 @@ namespace DeviceLibrary
operation
.
op
=
1
;
operation
.
data
=
new
Dictionary
<
string
,
string
>()
{
{
"code"
,
code
},
{
"boxId"
,
StoreID
.
ToString
()
},
{
"doorReelSignal"
,
"1"
}
};
if
(
reel
.
PlateH
==
100
&&
Setting_Init
.
Device_SingleInSingleOut
)
{
//singleIn 单盘入库
operation
.
data
.
Add
(
"singleIn"
,
"true"
);
}
else
{
operation
.
data
.
Add
(
"singleIn"
,
"false"
);
}
Operation
resultOperation
=
HttpHelper
.
Post
(
GetPostApi
(),
operation
,
15000
,
printlog
);
if
(
resultOperation
==
null
||
operation
.
seq
!=
resultOperation
.
seq
)
{
...
...
DeviceLibrary/theMachine/DeviceBase.cs
查看文件 @
bd6dcba
...
...
@@ -12,23 +12,24 @@ namespace DeviceLibrary
{
public
class
DeviceBase
{
public
MsgService
Msg
;
public
MsgService
Msg
{
get
;
set
;
}
public
string
Name
{
get
;
set
;
}
public
string
Device
{
get
;
set
;
}
=
"root"
;
public
string
GroupName
{
get
;
set
;
}
public
void
StopMove
(
bool
ServoOff
=
false
)
{
//runStatus = RunStatus.Stop;
MoveInfo
.
List
.
ForEach
((
m
)=>
{
m
.
EndMove
();
});
AxisBean
.
StopMultiAxis
(
AxisBean
.
List
[
Devic
e
]);
AxisBean
.
StopMultiAxis
(
AxisBean
.
List
[
GroupNam
e
]);
if
(
ServoOff
)
{
AxisBean
.
CloseMultiAxis
(
AxisBean
.
List
[
Devic
e
]);
AxisBean
.
CloseMultiAxis
(
AxisBean
.
List
[
GroupNam
e
]);
}
}
public
void
OpenAllServo
()
{
AxisBean
.
RunMultiAxis
(
true
,
out
_
,
AxisBean
.
List
[
Devic
e
]);
AxisBean
.
RunMultiAxis
(
true
,
out
_
,
AxisBean
.
List
[
GroupNam
e
]);
}
int
logType
=
1000
;
string
WarnMsg
=
""
;
...
...
@@ -87,7 +88,7 @@ namespace DeviceLibrary
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W002_IOValue
))
{
ConfigIO
io
=
RobotManage
.
Config
.
GetWaitIO
(
wait
.
IoType
,
Devic
e
);
ConfigIO
io
=
RobotManage
.
Config
.
GetWaitIO
(
wait
.
IoType
,
GroupNam
e
);
NotOkMsg
=
MoveInfo
.
Name
+
crc
.
GetString
(
"Res0157"
,
"等待"
)+
"【"
+
io
.
DisplayStr
+
"】=【"
+
wait
.
IoValue
+
"】"
;
wait
.
IsEnd
=
IOManager
.
IOValue
(
wait
.
IoType
).
Equals
(
wait
.
IoValue
);
if
(!
wait
.
IsEnd
)
...
...
@@ -234,32 +235,30 @@ namespace DeviceLibrary
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IoHighType
,
IO_VALUE
.
HIGH
));
}
}
public
IO_VALUE
IOValue
(
string
ioType
)
=>
IOManager
.
IOValue
(
ioType
);
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
,
bool
isCheck
=
false
,
int
msTime
=
0
)
public
IO_VALUE
IOValue
(
string
ioType
)
=>
IOManager
.
IOValue
(
ioType
,
GroupName
);
public
void
IOMove
(
string
IoType
,
IO_VALUE
value
,
int
msTime
=
0
)
{
if
(
msTime
<=
0
)
{
if
(
isCheck
&&
(
IOValue
(
IoType
).
Equals
(
value
)))
{
return
;
}
IOManager
.
IOMove
(
IoType
,
value
);
IOManager
.
IOMove
(
IoType
,
value
,
GroupName
);
}
else
{
Task
.
Run
(()=>
{
IOManager
.
IOMove
(
IoType
,
value
);
IOManager
.
IOMove
(
IoType
,
value
,
GroupName
);
Thread
.
Sleep
(
msTime
);
IO_VALUE
tValue
=
value
.
Equals
(
IO_VALUE
.
HIGH
)
?
IO_VALUE
.
LOW
:
IO_VALUE
.
HIGH
;
LogUtil
.
info
(
Name
+
"定时回写IO: ["
+
IoType
+
"]=["
+
value
+
"],msTime="
+
msTime
);
IOManager
.
IOMove
(
IoType
,
tValue
);
IOManager
.
IOMove
(
IoType
,
tValue
,
GroupName
);
});
}
}
public
enum
StringStateE
{
None
=
0
,
...
...
DeviceLibrary/theMachine/MainMachine _IOMonitor.cs
查看文件 @
bd6dcba
...
...
@@ -20,28 +20,5 @@ namespace DeviceLibrary
Msg
.
add
(
crc
.
GetString
(
"Res0166"
,
"未检测到气压信号."
),
MsgLevel
.
warning
);
}
}
bool
lastTHoutRangeStatus
=
false
;
DateTime
lastTHoutRangeTime
=
DateTime
.
MaxValue
;
bool
IsTHoutRange
()
{
if
(
HumitureController
.
LastData
.
Humidity
>
ServerCM
.
Max_Humidity
// || HumitureController.LastData.Humidity < ServerCM.Min_Humidity
||
HumitureController
.
LastData
.
Temperate
>
ServerCM
.
Max_Temperature
)
{
if
(!
lastTHoutRangeStatus
)
lastTHoutRangeTime
=
DateTime
.
Now
;
lastTHoutRangeStatus
=
true
;
return
true
;
}
else
{
if
(
lastTHoutRangeStatus
)
lastTHoutRangeTime
=
DateTime
.
MaxValue
;
lastTHoutRangeStatus
=
false
;
return
false
;
}
}
bool
IsTHoutRangeOver30m
()
{
return
(
DateTime
.
Now
-
lastTHoutRangeTime
).
TotalMinutes
>
30
;
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
bd6dcba
...
...
@@ -82,12 +82,6 @@ namespace DeviceLibrary
//系统暂停, 绿闪,红闪
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
crc
.
GetString
(
"Res0169"
,
"暂停"
);
MachineLedState
.
Add
(
MachineLedStateE
.
SystemPause
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
blink
));
//温湿度超限30分钟. 红闪,黄闪
MachineLedStateName
[
MachineLedStateE
.
THoutRangeOver30m
]
=
crc
.
GetString
(
"Res0170"
,
"温湿度超限30分钟"
);
MachineLedState
.
Add
(
MachineLedStateE
.
THoutRangeOver30m
,
nls
(
LedState
.
blink
,
LedState
.
blink
,
LedState
.
none
));
//温湿度超限 绿闪黄闪
MachineLedStateName
[
MachineLedStateE
.
THoutRange
]
=
crc
.
GetString
(
"Res0171"
,
"温湿度超限"
);
MachineLedState
.
Add
(
MachineLedStateE
.
THoutRange
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
blink
));
//进出库, 绿亮,黄闪
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
crc
.
GetString
(
"Res0172"
,
"出入库中"
);
MachineLedState
.
Add
(
MachineLedStateE
.
InOut
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
on
));
...
...
@@ -139,22 +133,6 @@ namespace DeviceLibrary
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
InOut
);
}
//温度超限 绿亮 黄闪
if
(
IsTHoutRange
())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
THoutRange
);
}
//温度超限30分钟 绿亮 黄闪 红闪
if
(
IsTHoutRangeOver30m
())
{
//RunningLed.LedState = LedState.on;
//StandbyLed.LedState = LedState.blink;
//AlarmLed.LedState = LedState.blink;
ProcessLefCfg
(
MachineLedStateE
.
THoutRangeOver30m
);
}
//系统暂停,说明书未定义, 绿闪, 红闪
if
(!
canRunning
||
UserPause
)
{
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
bd6dcba
...
...
@@ -13,7 +13,7 @@ namespace DeviceLibrary
{
public
partial
class
MainMachine
:
DeviceBase
,
IRobot
{
public
string
Name
{
get
;
set
;
}
=
"MIMO_PLUS
"
;
new
public
string
Name
{
get
;
set
;
}
=
"Cycle Line
"
;
private
bool
_canRunning
=
true
;
public
bool
canRunning
{
...
...
@@ -33,27 +33,21 @@ namespace DeviceLibrary
public
Dictionary
<
string
,
DeviceGroup
>
DeviceGroup
{
get
=>
RobotManage
.
DeviceGroup
;
}
public
bool
UserPause
{
get
;
set
;
}
=
false
;
public
MoveInfo
ResetMoveInfo
;
public
delegate
void
ProcessMsg
(
List
<
Msg
>
msg
);
public
event
ProcessMsg
ProcessMsgEvent
;
ServerCommunication
ServerCM
=
new
ServerCommunication
();
/// <summary>
/// 开始运行的时间
/// </summary>
public
DateTime
StartTime
{
get
;
set
;
}
/// <summary>
/// 是否在急停中
/// </summary>
public
bool
isInSuddenDown
=
false
;
public
MainMachine
(
out
string
msg
)
{
GroupName
=
"root"
;
msg
=
""
;
Config
=
RobotManage
.
Config
;
Msg
=
new
MsgService
(
"root"
);
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
SideMove
.
Init
(
Config
,
DeviceGroup
,
out
string
m
);
...
...
@@ -79,7 +73,7 @@ namespace DeviceLibrary
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
{
ResetMoveInfo
.
Name
=
crc
.
GetString
(
"Res0173"
,
"重置"
);
//
ResetMoveInfo.Name = crc.GetString("Res0173","重置");
}
public
bool
hasAlarm
=
false
;
...
...
@@ -107,7 +101,7 @@ namespace DeviceLibrary
}
else
if
(
runStatus
==
RunStatus
.
HomeReset
)
{
HomeReset
()
;
runStatus
=
RunStatus
.
Running
;
}
}
catch
(
Exception
ex
)
...
...
@@ -150,18 +144,13 @@ namespace DeviceLibrary
LogUtil
.
info
(
"主线程已退出."
);
}
public
void
Start
()
{
ServerCM
.
StartConnectServer
();
Run
();
}
public
void
Stop
()
{
mstart
=
false
;
ServerCM
.
StopConnectServer
();
Thread
.
Sleep
(
300
);
Alarm
(
AlarmType
.
None
);
StopMove
(
true
);
LedProcess
(
null
);
}
public
void
BeginHomeReset
(
bool
firstRun
=
false
)
{
if
(!
firstRun
)
...
...
@@ -172,52 +161,13 @@ namespace DeviceLibrary
OpenAllServo
();
Alarm
(
AlarmType
.
None
);
runStatus
=
RunStatus
.
HomeReset
;
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
ResetMoveInfo
.
log
(
"开始回原"
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
1000
));
SideMove
.
SideMoves
.
Values
.
ToList
().
ForEach
(
s
=>
s
.
Start
());
}
//强制回原
bool
forceHome
=
true
;
void
HomeReset
()
{
if
(
CheckWait
(
ResetMoveInfo
))
return
;
switch
(
ResetMoveInfo
.
MoveStep
)
{
case
MoveStep
.
H01_HomeReset
:
ServerCM
.
storeStatus
=
StoreStatus
.
ResetMove
;
break
;
case
MoveStep
.
H02_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H03_HomeReset
);
ResetMoveInfo
.
log
(
"夹爪升降上升"
);
ResetMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
500
));
break
;
case
MoveStep
.
H03_HomeReset
:
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H04_HomeReset
);
break
;
case
MoveStep
.
HEND_HomeReset
:
forceHome
=
false
;
ResetMoveInfo
.
log
(
"回原完成"
);
ResetMoveInfo
.
EndMove
();
runStatus
=
RunStatus
.
Running
;
ServerCM
.
storeStatus
=
StoreStatus
.
StoreOnline
;
break
;
}
}
bool
_IgnoreSafecheck
=
false
;
public
bool
IgnoreSafecheck
{
get
=>
_IgnoreSafecheck
;
set
{
_IgnoreSafecheck
=
value
;
}
}
public
bool
IgnoreGratingSignal
=
false
;
bool
lastSafeCheckStatus
=
true
;
bool
SafeCheck
()
{
bool
ok
=
true
;
var
ignorestring
=
"["
+
crc
.
GetString
(
"Res0174"
,
"已忽略"
)
+
"]"
;
if
(!
lastSafeCheckStatus
&&
ok
)
{
SafetyDevice
.
ResumeAll
();
...
...
@@ -229,13 +179,9 @@ namespace DeviceLibrary
void
DeviceSuddenStop
()
{
if
(
lastSafeCheckStatus
)
{
AxisBean
.
StopMultiAxis
(
AxisBean
.
List
[
Devic
e
]);
AxisBean
.
StopMultiAxis
(
AxisBean
.
List
[
GroupNam
e
]);
MoveInfo
.
List
.
ForEach
((
m
)
=>
{
m
.
CanWhileCount
=
5
;
});
SafetyDevice
.
PauseAll
();
if
(
runStatus
==
RunStatus
.
HomeReset
)
{
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
}
}
}
...
...
@@ -248,9 +194,15 @@ namespace DeviceLibrary
public
bool
DeviceCheck
()
{
bool
ok
=
true
;
isInSuddenDown
=
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
);
if
(
UserPause
)
if
(
IOValue
(
IO_Type
.
AutoRun_Single
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"自动运行开关未开"
,
MsgLevel
.
warning
);
DeviceSuddenStop
();
lastSafeCheckStatus
=
false
;
ok
=
false
;
}
else
if
(
UserPause
)
{
Msg
.
add
(
crc
.
GetString
(
"Res0175"
,
"系统暂停"
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0175"
,
"系统暂停"
),
MsgLevel
.
warning
);
DeviceSuddenStop
();
lastSafeCheckStatus
=
false
;
ok
=
false
;
...
...
@@ -259,20 +211,14 @@ namespace DeviceLibrary
else
if
(
isInSuddenDown
)
{
Alarm
(
AlarmType
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
"Res0176"
,
"急停中"
),
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0176"
,
"急停中"
),
MsgLevel
.
alarm
);
ok
=
false
;
}
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
else
if
(
alarmType
!=
AlarmType
.
None
)
{
Msg
.
add
(
crc
.
GetString
(
"Res0177"
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
"Res0177"
,
"系统需要重置"
),
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
}
}
if
(
IOValue
(
IO_Type
.
Airpressure_Check
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(
lastAirCloseTime
==
DateTime
.
MinValue
)
...
...
DeviceLibrary/theMachine/MoveStep.cs
查看文件 @
bd6dcba
...
...
@@ -33,6 +33,20 @@ namespace DeviceLibrary
SideMove_02
,
SideMove_03
,
SideMove_04
,
SideMove_05
,
SideMove_06
,
SideMove_07
,
SideMove_08
,
SideMove_09
,
SideMove_10
,
SideMove_11
,
SideMove_12
,
SideMove_13
,
SideMove_14
,
SideMove_15
,
SideMove_16
,
SideMove_17
,
SideMove_18
,
}
...
...
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
bd6dcba
...
...
@@ -128,22 +128,6 @@ namespace DeviceLibrary
else
LogUtil
.
info
(
"用户取消暂停:"
+
msg
);
}
public
static
void
IgnoreSafecheck
(
bool
s
)
{
mainMachine
.
IgnoreSafecheck
=
s
;
if
(
s
)
LogUtil
.
info
(
"用户设置忽略安全检查"
);
else
LogUtil
.
info
(
"用户取消忽略安全检查"
);
}
public
static
void
IgnoreGratingSignal
(
bool
s
)
{
mainMachine
.
IgnoreGratingSignal
=
s
;
if
(
s
)
LogUtil
.
info
(
"用户设置忽略安全光栅"
);
else
LogUtil
.
info
(
"用户取消忽略安全光栅"
);
}
}
public
enum
StoreType
{
...
...
DeviceLibrary/theMachine/sub/IDevice.cs
查看文件 @
bd6dcba
...
...
@@ -6,9 +6,20 @@ using System.Threading.Tasks;
namespace
DeviceLibrary
{
interface
IDevice
public
interface
IDevice
{
void
Process
();
void
ResetProcess
();
MsgService
Msg
{
get
;
set
;
}
string
GroupName
{
get
;
}
DeviceStateE
DeviceState
{
get
;
set
;
}
void
Start
();
void
Stop
();
}
public
enum
DeviceStateE
{
Stop
,
HomeReset
,
Run
}
}
DeviceLibrary/theMachine/sub/SideMove.cs
查看文件 @
bd6dcba
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/sub/TransplantMove.cs
查看文件 @
bd6dcba
...
...
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
namespace
DeviceLibrary
{
public
class
TransplantMove
:
DeviceBase
,
IDevice
public
class
TransplantMove
:
DeviceBase
,
IDevice
,
ISafetyDevice
{
static
List
<
TransplantMove
>
SideMoves
=
new
List
<
TransplantMove
>();
...
...
@@ -28,13 +28,17 @@ namespace DeviceLibrary
PuYueRFID_C2S
RFID_1
=
null
;
PuYueRFID_C2S
RFID_2
=
null
;
AxisBean
axis
;
public
DeviceStateE
DeviceState
{
get
=>
throw
new
NotImplementedException
();
set
=>
throw
new
NotImplementedException
();
}
public
TransplantMove
(
DeviceGroup
device
,
out
string
msg
)
{
msg
=
""
;
Name
=
device
.
Name
+
"("
+
device
.
GroupName
+
")"
;
DeviceGroup
=
device
;
Device
=
DeviceGroup
.
GroupName
;
Msg
=
new
MsgService
(
Device
);
MoveInfo
=
new
MoveInfo
(
device
.
GroupName
);
GroupName
=
DeviceGroup
.
GroupName
;
Msg
=
new
MsgService
(
GroupName
);
MoveInfo
=
new
MoveInfo
(
GroupName
);
SafetyDevice
.
AddDevice
(
this
);
if
(!
string
.
IsNullOrEmpty
(
DeviceGroup
.
RFID_1
))
{
RFID_1
=
new
PuYueRFID_C2S
(
DeviceGroup
.
RFID_1
);
...
...
@@ -50,8 +54,8 @@ namespace DeviceLibrary
msg
+=
DeviceGroup
.
DeviceType
+
" RFID 2:"
+
DeviceGroup
.
RFID_2
+
","
+
crc
.
GetString
(
"Res0183"
,
"打开失败"
)
+
"\r\n"
;
}
}
var
axisc
=
RobotManage
.
Config
.
moveAxisList
.
Find
(
ma
=>
ma
.
GetAxisValue
()
==
RobotManage
.
DeviceGroup
[
device
.
GroupName
].
AxisID
);
axis
=
new
AxisBean
(
axisc
,
device
.
GroupName
);
var
axisc
=
RobotManage
.
Config
.
moveAxisList
.
Find
(
ma
=>
ma
.
GetAxisValue
()
==
RobotManage
.
DeviceGroup
[
GroupName
].
AxisID
);
axis
=
new
AxisBean
(
axisc
,
GroupName
);
}
public
void
Process
()
{
...
...
@@ -73,8 +77,8 @@ namespace DeviceLibrary
MoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_A_Location_Up
,
IO_Type
.
Ls_A_Location_Down
,
IO_VALUE
.
LOW
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_B_Location_Up
,
IO_Type
.
Ls_B_Location_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
false
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
false
,
500
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
500
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Ls_A_Tray_Check
,
IO_VALUE
.
HIGH
));
}
else
{
...
...
@@ -97,7 +101,22 @@ namespace DeviceLibrary
}
}
public
void
ResetProcess
()
public
void
Start
()
{
throw
new
NotImplementedException
();
}
public
void
Stop
()
{
throw
new
NotImplementedException
();
}
public
void
Pause
()
{
throw
new
NotImplementedException
();
}
public
void
Resume
()
{
throw
new
NotImplementedException
();
}
...
...
DeviceLibrary/theMachine/sub/TrayStop.cs
查看文件 @
bd6dcba
...
...
@@ -28,12 +28,16 @@ namespace DeviceLibrary
PuYueRFID_C2S
RFID_1
=
null
;
PuYueRFID_C2S
RFID_2
=
null
;
AxisBean
axis
;
AxisBean
axis2
;
public
DeviceStateE
DeviceState
{
get
=>
throw
new
NotImplementedException
();
set
=>
throw
new
NotImplementedException
();
}
public
TrayStop
(
DeviceGroup
device
,
out
string
msg
)
{
msg
=
""
;
Name
=
device
.
Name
+
"("
+
device
.
GroupName
+
")"
;
DeviceGroup
=
device
;
Devic
e
=
DeviceGroup
.
GroupName
;
Msg
=
new
MsgService
(
Devic
e
);
GroupNam
e
=
DeviceGroup
.
GroupName
;
Msg
=
new
MsgService
(
GroupNam
e
);
MoveInfo
=
new
MoveInfo
(
device
.
GroupName
);
if
(!
string
.
IsNullOrEmpty
(
DeviceGroup
.
RFID_1
))
{
...
...
@@ -53,6 +57,9 @@ namespace DeviceLibrary
var
axisc
=
RobotManage
.
Config
.
moveAxisList
.
Find
(
ma
=>
ma
.
GetAxisValue
()
==
RobotManage
.
DeviceGroup
[
device
.
GroupName
].
AxisID
);
if
(
axisc
!=
null
)
axis
=
new
AxisBean
(
axisc
,
device
.
GroupName
);
var
axisc2
=
RobotManage
.
Config
.
moveAxisList
.
Find
(
ma
=>
ma
.
GetAxisValue
()
==
RobotManage
.
DeviceGroup
[
device
.
GroupName
].
Axis2ID
);
if
(
axisc2
!=
null
)
axis2
=
new
AxisBean
(
axisc2
,
device
.
GroupName
);
}
public
void
Process
()
{
...
...
@@ -74,8 +81,8 @@ namespace DeviceLibrary
MoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_A_Location_Up
,
IO_Type
.
Ls_A_Location_Down
,
IO_VALUE
.
LOW
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_B_Location_Up
,
IO_Type
.
Ls_B_Location_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
false
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
false
,
500
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
500
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Ls_A_Tray_Check
,
IO_VALUE
.
HIGH
));
}
else
{
...
...
@@ -118,8 +125,8 @@ namespace DeviceLibrary
MoveInfo
.
NextMoveStep
(
MoveStep
.
SideMove_01
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_A_Location_Up
,
IO_Type
.
Ls_A_Location_Down
,
IO_VALUE
.
LOW
);
CylinderMove
(
MoveInfo
,
IO_Type
.
Ls_B_Location_Up
,
IO_Type
.
Ls_B_Location_Down
,
IO_VALUE
.
LOW
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
false
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
false
,
500
);
IOMove
(
IO_Type
.
Ls_A_Front_Stop
,
IO_VALUE
.
HIGH
,
1000
);
IOMove
(
IO_Type
.
Ls_A_BufStop_Fwd
,
IO_VALUE
.
HIGH
,
500
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Ls_A_Tray_Check
,
IO_VALUE
.
HIGH
));
}
else
...
...
@@ -142,6 +149,17 @@ namespace DeviceLibrary
break
;
}
}
public
void
Start
()
{
throw
new
NotImplementedException
();
}
public
void
Stop
()
{
throw
new
NotImplementedException
();
}
enum
LS_TypeE
{
NoRfid
,
OneWay
,
...
...
LoadCVSLibrary/Config/Config.csv
查看文件 @
bd6dcba
...
...
@@ -16,7 +16,7 @@ PRO,10,AMH移栽设备每毫米脉冲,AMH_TS_PoToMM,1000,,,,,,,,,,,,
PRO,10,AMH移栽设备待机点P1,AMH_TS_P1,1000,,,10000,,,,,,,,,
PRO,14,机器人压紧轴每毫米脉冲,AMH_RoboComp_PoToMM,1000,,,,,,,,,,,,
PRO,14,机器人压紧轴待机点P1,AMH_RoboComp_P1,1000,,,10000,,,,,,,,,
,,,,
,,,,,,,,,,,,
PRO,50,托盘旋转轴每度脉冲,AMH_Route_PoToMM,1000
,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,,X00,,,,,,,,,,
DI,0,复位,Reset_BTN,1,,X01,,,,,,,,,,
...
...
LoadCVSLibrary/Config/DeviceGroup.csv
查看文件 @
bd6dcba
设备组,名称,设备类型,RFID-1,RFID-2,伺服轴号,地址号-1,地址号-2,设备侧8mm放料点,料仓侧8mm放料点,位置,优先级,高度,宽度
LS1,横移,LS,,,,11,12,,,,,,
LS2,横移,LS,192.168.103.115,,,9,15,,,,,,
LS3,横移,LS,192.168.103.110,192.168.103.106,,4,19,,,,,,
LS4,横移,LS,,,,0,1,,,,,,
,,,,,,,,,,,,,
AMH-MI1,定位,RT,192.168.103.103,,4,16,,,345,,,,
AMH-MI2,定位,RT,192.168.103.107,,9,20,,,345,,,,
,,,,,,,,,,,,,
AMH-ML5-1,定位,RT,192.168.103.108,,-1,2,,,,,,,
AMH-ML5-2,定位,RT,192.168.103.109,,-1,3,,,,,,,
,,,,,,,,,,,,,
CI,定位,RT,192.168.103.111,,-1,5,,,,,,,
,,,,,,,,,,,,,
AMH-SBSH2,移栽,SISO,192.168.103.116,,0,10,,123,234,,,,
AMH-SBDH2-1,移栽,SISO,192.168.103.101,,1,13,,123,234,,,,
AMH-SBDH2-2,移栽,SISO,192.168.103.102,,2,14,,123,234,,,,
AMH-SBSH1,移栽,SISO,192.168.103.114,,3,8,,123,234,,,,
AMH-SBDH3-1,移栽,SISO,192.168.103.112,,5,6,,123,234,,,,
AMH-SBDH3-2,移栽,SISO,192.168.103.113,,6,7,,123,234,,,,
AMH-SBDH1-1,移栽,SISO,192.168.103.104,,7,17,,123,234,,,,
AMH-SBDH1-2,移栽,SISO,192.168.103.105,,8,18,,123,234,,,,
设备组,名称,设备类型,RFID-1,RFID-2,伺服轴号,
伺服轴号2,
地址号-1,地址号-2,设备侧8mm放料点,料仓侧8mm放料点,位置,优先级,高度,宽度
LS1,横移,LS,,,,
,
11,12,,,,,,
LS2,横移,LS,192.168.103.115,,,
,
9,15,,,,,,
LS3,横移,LS,192.168.103.110,192.168.103.106,,
,
4,19,,,,,,
LS4,横移,LS,,,,
,
0,1,,,,,,
,,,,,,,,,,,,,
,
AMH-MI1,定位,RT,192.168.103.103,,4,
4,
16,,,345,,,,
AMH-MI2,定位,RT,192.168.103.107,,9,
9,
20,,,345,,,,
,,,,,,,,,,,,,
,
AMH-ML5-1,定位,RT,192.168.103.108,,-1,
,
2,,,,,,,
AMH-ML5-2,定位,RT,192.168.103.109,,-1,
,
3,,,,,,,
,,,,,,,,,,,,,
,
CI,定位,RT,192.168.103.111,,-1,
,
5,,,,,,,
,,,,,,,,,,,,,
,
AMH-SBSH2,移栽,SISO,192.168.103.116,,0,
,
10,,123,234,,,,
AMH-SBDH2-1,移栽,SISO,192.168.103.101,,1,
,
13,,123,234,,,,
AMH-SBDH2-2,移栽,SISO,192.168.103.102,,2,
,
14,,123,234,,,,
AMH-SBSH1,移栽,SISO,192.168.103.114,,3,
,
8,,123,234,,,,
AMH-SBDH3-1,移栽,SISO,192.168.103.112,,5,
,
6,,123,234,,,,
AMH-SBDH3-2,移栽,SISO,192.168.103.113,,6,
,
7,,123,234,,,,
AMH-SBDH1-1,移栽,SISO,192.168.103.104,,7,
,
17,,123,234,,,,
AMH-SBDH1-2,移栽,SISO,192.168.103.105,,8,
,
18,,123,234,,,,
LoadCVSLibrary/position/DeviceGroup.cs
查看文件 @
bd6dcba
...
...
@@ -45,6 +45,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[
CSVAttribute
(
"伺服轴号"
)]
public
int
AxisID
{
get
;
set
;
}
/// <summary>
/// 伺服轴号
/// </summary>
[
CSVAttribute
(
"伺服轴号2"
)]
public
int
Axis2ID
{
get
;
set
;
}
/// <summary>
/// 地址号-1
...
...
TheMachine/Form1.Designer.cs
查看文件 @
bd6dcba
...
...
@@ -43,8 +43,6 @@ namespace TheMachine
this
.
pnl
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
stateView
=
new
System
.
Windows
.
Forms
.
ListView
();
this
.
cb_IgnoreSafecheck
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cb_IgnoreGratingSignal
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cb_EnableBuzzer
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btn_PauseBuzzer
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
listView1
=
new
System
.
Windows
.
Forms
.
ListView
();
...
...
@@ -116,7 +114,7 @@ namespace TheMachine
// 简体中文ToolStripMenuItem
//
this
.
简体中文
ToolStripMenuItem
.
Name
=
"简体中文ToolStripMenuItem"
;
this
.
简体中文
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
简体中文
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
简体中文
ToolStripMenuItem
.
Tag
=
"not"
;
this
.
简体中文
ToolStripMenuItem
.
Text
=
"简体中文"
;
this
.
简体中文
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
简体中文
ToolStripMenuItem_Click
);
...
...
@@ -124,7 +122,7 @@ namespace TheMachine
// englishToolStripMenuItem
//
this
.
englishToolStripMenuItem
.
Name
=
"englishToolStripMenuItem"
;
this
.
englishToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
80
,
26
);
this
.
englishToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
1
44
,
26
);
this
.
englishToolStripMenuItem
.
Tag
=
"not"
;
this
.
englishToolStripMenuItem
.
Text
=
"English"
;
this
.
englishToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
englishToolStripMenuItem_Click
);
...
...
@@ -163,8 +161,6 @@ namespace TheMachine
// pnl
//
this
.
pnl
.
Controls
.
Add
(
this
.
groupBox1
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_IgnoreSafecheck
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_IgnoreGratingSignal
);
this
.
pnl
.
Controls
.
Add
(
this
.
cb_EnableBuzzer
);
this
.
pnl
.
Controls
.
Add
(
this
.
btn_PauseBuzzer
);
this
.
pnl
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
...
...
@@ -196,28 +192,6 @@ namespace TheMachine
this
.
stateView
.
TabIndex
=
0
;
this
.
stateView
.
UseCompatibleStateImageBehavior
=
false
;
//
// cb_IgnoreSafecheck
//
this
.
cb_IgnoreSafecheck
.
AutoSize
=
true
;
this
.
cb_IgnoreSafecheck
.
Location
=
new
System
.
Drawing
.
Point
(
607
,
47
);
this
.
cb_IgnoreSafecheck
.
Name
=
"cb_IgnoreSafecheck"
;
this
.
cb_IgnoreSafecheck
.
Size
=
new
System
.
Drawing
.
Size
(
215
,
25
);
this
.
cb_IgnoreSafecheck
.
TabIndex
=
2
;
this
.
cb_IgnoreSafecheck
.
Text
=
"忽略安全检查(含安全光栅)"
;
this
.
cb_IgnoreSafecheck
.
UseVisualStyleBackColor
=
true
;
this
.
cb_IgnoreSafecheck
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_IgnoreSafecheck_CheckedChanged
);
//
// cb_IgnoreGratingSignal
//
this
.
cb_IgnoreGratingSignal
.
AutoSize
=
true
;
this
.
cb_IgnoreGratingSignal
.
Location
=
new
System
.
Drawing
.
Point
(
607
,
78
);
this
.
cb_IgnoreGratingSignal
.
Name
=
"cb_IgnoreGratingSignal"
;
this
.
cb_IgnoreGratingSignal
.
Size
=
new
System
.
Drawing
.
Size
(
125
,
25
);
this
.
cb_IgnoreGratingSignal
.
TabIndex
=
2
;
this
.
cb_IgnoreGratingSignal
.
Text
=
"忽略安全光栅"
;
this
.
cb_IgnoreGratingSignal
.
UseVisualStyleBackColor
=
true
;
this
.
cb_IgnoreGratingSignal
.
CheckedChanged
+=
new
System
.
EventHandler
(
this
.
cb_IgnoreGratingSignal_CheckedChanged
);
//
// cb_EnableBuzzer
//
this
.
cb_EnableBuzzer
.
AutoSize
=
true
;
...
...
@@ -323,8 +297,6 @@ namespace TheMachine
private
System
.
Windows
.
Forms
.
TabPage
tabP1
;
private
System
.
Windows
.
Forms
.
ListView
stateView
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_IgnoreSafecheck
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_IgnoreGratingSignal
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
关于
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
CheckBox
cb_EnableBuzzer
;
private
System
.
Windows
.
Forms
.
Button
btn_PauseBuzzer
;
...
...
TheMachine/Form1.cs
查看文件 @
bd6dcba
...
...
@@ -184,10 +184,6 @@ namespace TheMachine
stateView
.
Items
.
Clear
();
foreach
(
MoveInfo
moveInfo
in
moveInfoList
)
{
if
(
moveInfo
.
Equals
(
RobotManage
.
mainMachine
.
ResetMoveInfo
)
&&
RobotManage
.
mainMachine
.
runStatus
!=
RunStatus
.
HomeReset
)
{
continue
;
}
ListViewItem
lvi
=
new
ListViewItem
(
new
string
[]
{
""
,
moveInfo
.
Name
,
moveInfo
.
MoveStep
.
ToString
(),
moveInfo
.
GetStateStr
()
});
stateView
.
Items
.
Add
(
lvi
);
}
...
...
@@ -352,8 +348,14 @@ namespace TheMachine
{
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
SuddenStop_BTN
).
Equals
(
IO_VALUE
.
LOW
))
{
//Msg.add(crc.GetString(L.device_suddenstop_cant_start, "急停中,无法启动"), MsgLevel.warning);
//MainMachine_ProcessMsgEvent(Msg.get());
RobotManage
.
mainMachine
.
Msg
.
add
(
"急停中,无法启动"
,
MsgLevel
.
warning
);
MainMachine_ProcessMsgEvent
(
RobotManage
.
mainMachine
.
Msg
.
get
().
Values
.
First
());
return
;
}
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
AutoRun_Single
).
Equals
(
IO_VALUE
.
LOW
))
{
RobotManage
.
mainMachine
.
Msg
.
add
(
"运行开关没有打开,无法启动"
,
MsgLevel
.
warning
);
MainMachine_ProcessMsgEvent
(
RobotManage
.
mainMachine
.
Msg
.
get
().
Values
.
First
());
return
;
}
RobotManage
.
Start
();
...
...
@@ -393,14 +395,14 @@ namespace TheMachine
userpause
=
true
;
(
btn_run
as
Button
).
Text
=
crc
.
GetString
(
"Res0203"
,
"恢复运行"
);
(
btn_run
as
Button
).
BackColor
=
Color
.
LightGreen
;
cb_IgnoreSafecheck
.
Enabled
=
true
;
}
else
{
userpause
=
false
;
(
btn_run
as
Button
).
Text
=
crc
.
GetString
(
"Res0204"
,
"暂停运行"
);
(
btn_run
as
Button
).
BackColor
=
Color
.
Yellow
;
cb_IgnoreSafecheck
.
Enabled
=
false
;
}
}
...
...
@@ -420,7 +422,6 @@ namespace TheMachine
btn_stop
.
Enabled
=
false
;
btn_run
.
Text
=
crc
.
GetString
(
"Res0205"
,
"启动"
);
btn_run
.
BackColor
=
Color
.
Transparent
;
cb_IgnoreSafecheck
.
Enabled
=
true
;
}
private
void
退出
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
...
...
@@ -435,16 +436,6 @@ namespace TheMachine
}
}
private
void
cb_IgnoreSafecheck_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
RobotManage
.
IgnoreSafecheck
((
sender
as
CheckBox
).
Checked
);
}
private
void
cb_IgnoreGratingSignal_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
RobotManage
.
IgnoreGratingSignal
((
sender
as
CheckBox
).
Checked
);
}
private
void
关于
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
AboutBox1
aboutBox1
=
new
AboutBox1
();
...
...
TheMachine/SettingControl.cs
查看文件 @
bd6dcba
...
...
@@ -33,7 +33,7 @@ namespace TheMachine
{
if
(!
state
)
return
;
uC_LedConfig1
.
Config
=
RobotManage
.
Config
;
}
private
void
SettingControl_Load
(
object
sender
,
EventArgs
e
)
...
...
@@ -69,11 +69,6 @@ namespace TheMachine
private
void
cb_tempsensorport_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
HumitureController
.
Init
(
Setting_Init
.
Device_Humiture_Port
);
}
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(!
Visible
)
...
...
@@ -81,9 +76,5 @@ namespace TheMachine
}
private
void
button1_Click_1
(
object
sender
,
EventArgs
e
)
{
}
}
}
TheMachine/device/HYControl.cs
查看文件 @
bd6dcba
...
...
@@ -26,20 +26,20 @@ namespace TheMachine
crc
.
LanguageChangeEvent
+=
(
s
,
o
)=>
crc
.
LanguageProcess
(
this
);
crc
.
CurrLanguage
=
Setting_Init
.
Device_Default_Language
;
}
public
void
Init
(
string
devicetype
)
public
void
Init
(
string
_deviceGroup
)
{
this
.
device
type
=
devicetype
;
this
.
device
Group
=
_deviceGroup
;
foreach
(
var
c
in
this
.
Controls
)
{
if
(!(
c
is
CylinderButton
))
continue
;
var
cc
=
(
c
as
CylinderButton
);
cc
.
DeviceType
=
device
type
;
if
(!
RobotManage
.
Config
.
DOList
[
device
type
].
ContainsKey
(
cc
.
IO_HIGH
))
cc
.
DeviceType
=
device
Group
;
if
(!
RobotManage
.
Config
.
DOList
[
device
Group
].
ContainsKey
(
cc
.
IO_HIGH
))
cc
.
Visible
=
false
;
}
ioControl1
.
Init
(
RobotManage
.
Config
,
device
type
);
if
(!
RobotManage
.
Config
.
DOList
[
device
type
].
ContainsKey
(
IO_Type
.
Ls_A_LineRun
))
{
ioControl1
.
Init
(
RobotManage
.
Config
,
device
Group
);
if
(!
RobotManage
.
Config
.
DOList
[
device
Group
].
ContainsKey
(
IO_Type
.
Ls_A_LineRun
))
{
btn_linerun
.
Visible
=
false
;
btn_linerev
.
Visible
=
false
;
...
...
@@ -47,23 +47,20 @@ namespace TheMachine
}
crc
.
LanguageProcess
(
this
);
}
string
device
type
=
"root"
;
string
device
Group
;
private
void
btn_linerun_Click
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRwd
,
IO_VALUE
.
LOW
,
devicetype
);
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRun
,
IO_VALUE
.
HIGH
,
devicetype
);
SideMove
.
SideMoves
[
deviceGroup
].
Line
.
LineRun
(
"n"
,
false
,
999
);
}
private
void
btn_linerev_Click
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRwd
,
IO_VALUE
.
HIGH
,
devicetype
);
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRun
,
IO_VALUE
.
HIGH
,
devicetype
);
SideMove
.
SideMoves
[
deviceGroup
].
Line
.
LineRun
(
"n"
,
true
,
999
);
}
private
void
btn_linestop_Click
(
object
sender
,
EventArgs
e
)
{
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRwd
,
IO_VALUE
.
LOW
,
devicetype
);
IOManager
.
IOMove
(
IO_Type
.
Ls_A_LineRun
,
IO_VALUE
.
LOW
,
devicetype
);
SideMove
.
SideMoves
[
deviceGroup
].
Line
.
LineStop
(
"n"
);
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论