Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1053_DualSISO
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ad0410c7
由
刘韬
编写于
2022-08-17 13:12:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
2768259f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
31 个修改的文件
包含
239 行增加
和
211 行删除
Common/util/HumitureController.cs
Common/util/TcpServer.cs
Common/util/UdpServer.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/DeviceLibrary/Camera.cs
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
DeviceLibrary/StoreConfig/Right/linePositions.csv
DeviceLibrary/theMachine/BoxTransport.cs
DeviceLibrary/theMachine/LabelParam.cs
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/RobotManage.cs
DeviceLibrary/theMachine/Store/MainMachine _IOMonitor.cs
DeviceLibrary/theMachine/Store/StoreMachine.cs
DeviceLibrary/theMachine/Store/StoreMachine_AutoInOutTest.cs
DeviceLibrary/theMachine/Store/StoreMachine_Store.cs
DeviceLibrary/userControl/AxisMoveControl.cs
DeviceLibrary/userControl/AxisTipControl.cs
DeviceLibrary/userControl/FixtureSizeConfigControl.cs
LoadCVSLibrary/Program.cs
LoadCVSLibrary/storeConfig/ConfigItemBase.cs
TheMachine/Form1.cs
TheMachine/SettingControl.cs
TheMachine/StoreSettingControl.cs
TheMachine/UC/ConfigControl.cs
TheMachine/UC/UC_LedConfig.cs
TheMachine/UC/uc_boxdebug.cs
TheMachine/UCStoreMachine.cs
TheMachine/positionTool/FrmPositionTool.cs
Common/util/HumitureController.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
log4net
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -38,7 +39,7 @@ namespace OnlineStore.Common
{
Release
();
}
LogName
=
"温湿度传感器
["
+
port
+
"]"
;
LogName
=
crc
.
GetString
(
"Res0115"
,
"温湿度传感器"
)+
"
["
+
port
+
"]"
;
if
(
sb
==
null
)
{
...
...
@@ -325,4 +326,4 @@ namespace OnlineStore.Common
}
}
}
}
\ No newline at end of file
Common/util/TcpServer.cs
查看文件 @
ad0410c
using
System
;
using
OnlineStore
;
using
System
;
using
System.Text
;
using
System.Windows.Forms
;
...
...
@@ -33,7 +34,7 @@ namespace OnlineStore.Common
private
void
logLocalIp
()
{
string
[]
addresses
=
GetLocalAddresses
();
string
iplist
=
"本机IP:
["
;
string
iplist
=
crc
.
GetString
(
"Res0116"
,
"本机IP:"
)+
"
["
;
if
(
addresses
.
Length
>
0
)
{
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
...
...
@@ -263,4 +264,4 @@ namespace OnlineStore.Common
}
}
}
}
\ No newline at end of file
Common/util/UdpServer.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -26,7 +27,7 @@ namespace OnlineStore.Common
private
void
logLocalIp
()
{
string
[]
addresses
=
GetLocalAddresses
();
string
iplist
=
"本机IP:
["
;
string
iplist
=
crc
.
GetString
(
"Res0116"
,
"本机IP:"
)+
"
["
;
if
(
addresses
.
Length
>
0
)
{
for
(
int
i
=
0
;
i
<
addresses
.
Length
;
i
++)
...
...
@@ -156,4 +157,4 @@ namespace OnlineStore.Common
return
retval
;
}
}
}
}
\ No newline at end of file
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
ad0410c
...
...
@@ -115,7 +115,7 @@ namespace DeviceLibrary
/// <summary>
/// 松下伺服电机运动
/// </summary>
public
void
AbsMove
(
MoveInfo
MoveInfo
,
int
targetPosition
,
int
targetSpeed
)
public
void
AbsMove
(
MoveInfo
MoveInfo
,
int
targetPosition
,
int
targetSpeed
,
string
proname
=
""
)
{
if
(
IsInPosition
(
targetPosition
))
{
...
...
@@ -137,10 +137,21 @@ namespace DeviceLibrary
}
else
{
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
targetPosition
,
targetSpeed
));
Config
.
TargetPosition
=
targetPosition
;
var
AddSpeed
=
Config
.
AddSpeed
>
0
?
Config
.
AddSpeed
:
targetSpeed
*
4
;
var
DelSpeed
=
Config
.
DelSpeed
>
0
?
Config
.
DelSpeed
:
targetSpeed
*
4
;
//if (!string.IsNullOrEmpty(proname)) {
// var storeMachine = (machineSide == MachineSideE.Left) ? RobotManage.leftMachine : RobotManage.rightMachine;
// var c = storeMachine.Config.configList.Find(x => x.ProName == proname);
// if (c != null) {
// AddSpeed = AddSpeed*c.AddSpeed;
// }
//}
AxisManager
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPosition
,
targetSpeed
,
AddSpeed
,
DelSpeed
);
// Config.AddSpeed, Config.DelSpeed);
}
}
...
...
DeviceLibrary/DeviceLibrary/Camera.cs
查看文件 @
ad0410c
using
Asa.Camera
;
using
Asa.Camera
;
using
DeviceLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
...
...
@@ -40,7 +40,7 @@ public class HIKCamera
string
path
=
$
".\\Config\\{CameraID}.json"
;
if
(!
File
.
Exists
(
path
))
{
msg
=
Name
+
"找不到监控相机配置文件"
;
msg
=
Name
+
crc
.
GetString
(
"Res0117"
,
"找不到监控相机配置文件"
)
;
LogUtil
.
error
(
Name
+
"找不到监控相机配置文件"
+
path
);
return
false
;
}
...
...
@@ -59,7 +59,7 @@ public class HIKCamera
}
catch
(
Exception
e
)
{
msg
=
Name
+
"加载监控相机配置文件失败:"
+
e
.
ToString
();
msg
=
Name
+
crc
.
GetString
(
"Res0118"
,
"加载监控相机配置文件失败:"
)
+
e
.
ToString
();
LogUtil
.
error
(
Name
+
"加载监控相机配置文件失败:"
+
e
.
ToString
());
return
false
;
}
...
...
@@ -67,7 +67,7 @@ public class HIKCamera
Bitmap
bmp
=
camera
.
GetImage
(
DeviceName
);
if
(
bmp
==
null
)
{
msg
=
Name
+
"监控相机打开失败"
;
msg
=
Name
+
crc
.
GetString
(
"Res0119"
,
"监控相机打开失败"
)
;
LogUtil
.
error
(
Name
+
$
"监控相机打开失败"
);
return
false
;
}
...
...
@@ -182,4 +182,4 @@ public enum FixtureState
ToInSide
,
ToOutSide
,
ToFix
,
}
}
\ No newline at end of file
DeviceLibrary/DeviceLibrary/LiftMonitor.cs
查看文件 @
ad0410c
using
OnlineStore.Common
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -44,7 +45,7 @@ namespace DeviceLibrary
public
void
LiftUp
(
MoveInfo
moveInfo
)
{
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0120"
,
"界面"
)
,
false
);
if
(
IOManager
.
IOValue
(
up
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需上升"
);
return
;
...
...
@@ -83,7 +84,7 @@ namespace DeviceLibrary
public
void
LiftDown
(
MoveInfo
moveInfo
)
{
if
(
moveInfo
==
null
)
moveInfo
=
new
MoveInfo
(
"界面"
,
false
);
moveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0120"
,
"界面"
)
,
false
);
if
(
IOManager
.
IOValue
(
down
.
ToString
()).
Equals
(
IO_VALUE
.
HIGH
))
{
moveInfo
.
log
(
$
"{axisBean.AxisName},已在位置,无需下降"
);
...
...
@@ -124,4 +125,4 @@ namespace DeviceLibrary
return
false
;
}
}
}
}
\ No newline at end of file
DeviceLibrary/DeviceLibrary/ServerCommunication.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -208,7 +208,7 @@ namespace DeviceLibrary
sendmsg
=
string
.
Join
(
","
,
new
string
[]
{
WarnMsg
});
}
else
if
(
Machine
.
runStatus
==
RunStatus
.
Stop
){
sendmsg
=
"设备未启动"
;
sendmsg
=
crc
.
GetString
(
"Res0121"
,
"设备未启动"
)
;
}
lineOperation
.
msg
=
sendmsg
;
...
...
@@ -360,7 +360,7 @@ namespace DeviceLibrary
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
//SetWarnMsg(ResourceControl.InStoreNoPosition, message, posId);
WarnMsg
=
"入库未找到库位:"
+
posId
;
//0505
WarnMsg
=
crc
.
GetString
(
"Res0122"
,
"入库未找到库位:"
)
+
posId
;
//0505
LogUtil
.
info
(
"收到服务器入库命令:入库未找到库位:二维码【"
+
message
+
"】库位【"
+
posId
+
"】"
);
return
;
}
...
...
@@ -605,4 +605,4 @@ namespace DeviceLibrary
InStoreError
=
14
,
}
}
}
\ No newline at end of file
DeviceLibrary/StoreConfig/Right/linePositions.csv
查看文件 @
ad0410c
此文件的差异被折叠,
点击展开。
DeviceLibrary/theMachine/BoxTransport.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -40,7 +40,7 @@ namespace DeviceLibrary
Config
=
_Config
;
mainMachine
=
_mainMachine
;
Msg
=
MsgService
.
MSList
[
mainMachine
.
MachineSide
];
MoveInfo
=
new
MoveInfo
(
"出入库机构"
,
_mainMachine
.
MachineSide
,
false
);
MoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0123"
,
"出入库机构"
)
,
_mainMachine
.
MachineSide
,
false
);
To
=
null
;
From
=
null
;
#
region
初始化伺服轴
...
...
@@ -131,7 +131,7 @@ namespace DeviceLibrary
if
(!
IgnoreX09
&&
!
MoveInfo
.
MoveParam
.
ReelOnFixture
&&
IOManager
.
IOValue
(
SIO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
if
(!
IgnoreX09
&&
IOMonitor
.
IODebound
(
SIO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
5000
))
Msg
.
add
(
string
.
Format
(
"出入库时料叉{0}检测到有物料无法继续,请检查."
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
string
.
Format
(
crc
.
GetString
(
"Res0124"
,
"出入库时料叉{0}检测到有物料无法继续,请检查."
)
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
}
else
{
...
...
@@ -196,7 +196,7 @@ namespace DeviceLibrary
DoorControl
.
Invoke
(
false
);
if
(!
IgnoreX09
&&
IOManager
.
IOValue
(
SIO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
string
.
Format
(
"出库时料叉{0}没有检测到物料无法继续,请检查."
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
string
.
Format
(
crc
.
GetString
(
"Res0125"
,
"出库时料叉{0}没有检测到物料无法继续,请检查."
)
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
}
else
{
...
...
@@ -253,13 +253,13 @@ namespace DeviceLibrary
case
MoveStep
.
StoreTS11
:
if
(
To
.
posid
==
BoxStorePosition
.
ngdoor
)
{
if
(
IOManager
.
IOValue
(
SIO_Type
.
Door_Tray_Check
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"单料门口有料无法放料."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0126"
,
"单料门口有料无法放料."
)
,
MsgLevel
.
info
);
MoveInfo
.
log
(
$
"单料门口有料无法放料"
);
return
false
;
}
if
(!
DoorControl
.
Invoke
(
true
))
{
Msg
.
add
(
"等待单料口门开启."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0127"
,
"等待单料口门开启."
)
,
MsgLevel
.
info
);
MoveInfo
.
log
(
$
"等待单料口门开启"
);
return
false
;
}
...
...
@@ -288,7 +288,7 @@ namespace DeviceLibrary
RobotManage
.
CameraA
.
CameraGrabOne
(
RobotManage
.
CameraA
.
GetFixtureStateFilename
(
To
.
posid
,
WareCode
,
storeMoveType
,
FixtureState
.
ToOut
));
if
(!
IgnoreX09
&&
IOManager
.
IOValue
(
SIO_Type
.
TrayCheck_Fixture
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
string
.
Format
(
"入库后料叉{0}上任然检测到物料,请检查."
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
string
.
Format
(
crc
.
GetString
(
"Res0128"
,
"入库后料叉{0}上任然检测到物料,请检查."
)
,
Config
.
DIList
[
SIO_Type
.
TrayCheck_Fixture
].
ElectricalDefinition
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
}
else
{
...
...
@@ -351,4 +351,4 @@ namespace DeviceLibrary
return
RobotManage
.
CameraA
;
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/LabelParam.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -98,12 +98,12 @@ namespace DeviceLibrary
{
if
(
IsNg
)
{
return
"入库NG"
+
$
":{NgMsg}[{WareCode}]"
;
return
crc
.
GetString
(
"Res0129"
,
"入库NG"
)
+
$
":{NgMsg}[{WareCode}]"
;
}
else
{
return
"库位号"
+
$
":[{PosID}][{WareCode}] "
;
return
crc
.
GetString
(
"Res0130"
,
"库位号"
)
+
$
":[{PosID}][{WareCode}] "
;
}
}
...
...
@@ -217,4 +217,4 @@ namespace DeviceLibrary
{
NGDoor
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine _BtnProcess.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -22,16 +22,16 @@ namespace DeviceLibrary
{
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
MsgService
.
Add
(
"按下复位按钮."
,
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0131"
,
"按下复位按钮."
)
,
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
if
(!
RobotManage
.
isRunning
)
RobotManage
.
Start
(
MachineSideE
.
Left
|
MachineSideE
.
Right
);
}
else
{
MsgService
.
Add
(
"急停未解除,按下复位按钮尝试复位安全继电器."
,
MsgLevel
.
info
,
ErrInfo
.
SuddenStop
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0132"
,
"急停未解除,按下复位按钮尝试复位安全继电器."
)
,
MsgLevel
.
info
,
ErrInfo
.
SuddenStop
);
}
LogUtil
.
info
(
"按下复位按钮"
);
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine _LedProcess.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
OnlineStore
;
using
CodeLibrary
;
using
Newtonsoft.Json
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -67,19 +68,19 @@ namespace DeviceLibrary
{
MachineLedState
.
Clear
();
//系统报警并停止,红亮
MachineLedStateName
[
MachineLedStateE
.
AlarmStop
]
=
"停机报警"
;
MachineLedStateName
[
MachineLedStateE
.
AlarmStop
]
=
crc
.
GetString
(
"ledstate_AlarmStop"
,
"停机报警"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
AlarmStop
,
nls
(
LedState
.
on
,
LedState
.
off
,
LedState
.
off
));
//系统运行时报警, 绿亮,红闪
MachineLedStateName
[
MachineLedStateE
.
Alarm
]
=
"报警"
;
MachineLedStateName
[
MachineLedStateE
.
Alarm
]
=
crc
.
GetString
(
"ledstate_Alarm"
,
"报警"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
Alarm
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
on
));
//系统复位中 绿闪
MachineLedStateName
[
MachineLedStateE
.
HomeReset
]
=
"复位"
;
MachineLedStateName
[
MachineLedStateE
.
HomeReset
]
=
crc
.
GetString
(
"ledstate_HomeReset"
,
"复位"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
HomeReset
,
nls
(
LedState
.
off
,
LedState
.
off
,
LedState
.
blink
));
//系统正常运行
MachineLedStateName
[
MachineLedStateE
.
Running
]
=
"运行"
;
MachineLedStateName
[
MachineLedStateE
.
Running
]
=
crc
.
GetString
(
"ledstate_Running"
,
"运行"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
Running
,
nls
(
LedState
.
none
,
LedState
.
none
,
LedState
.
on
));
//系统暂停, 绿闪,红闪
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
"暂停"
;
MachineLedStateName
[
MachineLedStateE
.
SystemPause
]
=
crc
.
GetString
(
"ledstate_SystemPause"
,
"暂停"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
SystemPause
,
nls
(
LedState
.
blink
,
LedState
.
off
,
LedState
.
blink
));
//温湿度超限30分钟. 红闪,黄闪
//MachineLedStateName[MachineLedStateE.THoutRangeOver30m] = "温湿度超限30分钟";
...
...
@@ -88,7 +89,7 @@ namespace DeviceLibrary
// MachineLedStateName[MachineLedStateE.THoutRange] = "温湿度超限";
//MachineLedState.Add(MachineLedStateE.THoutRange, nls(LedState.none, LedState.blink, LedState.blink));
//进出库, 绿亮,黄闪
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
"出入库中"
;
MachineLedStateName
[
MachineLedStateE
.
InOut
]
=
crc
.
GetString
(
"ledstate_InOut"
,
"出入库中"
)
;
MachineLedState
.
Add
(
MachineLedStateE
.
InOut
,
nls
(
LedState
.
none
,
LedState
.
blink
,
LedState
.
on
));
}
Dictionary
<
LedColor
,
LedState
>
nls
(
LedState
AlarmLedstate
,
LedState
StandbyLedstate
,
LedState
RunningLedstate
)
{
...
...
@@ -218,4 +219,4 @@ namespace DeviceLibrary
THoutRange
,
InOut
,
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -141,7 +141,7 @@ namespace DeviceLibrary
isInSuddenDown
=
IOValue
(
IO_Type
.
SuddenStop_BTN
,
Config
).
Equals
(
IO_VALUE
.
LOW
);
if
(
UserPause
)
{
MsgService
.
Add
(
"系统暂停"
,
MsgLevel
.
warning
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0133"
,
"系统暂停"
)
,
MsgLevel
.
warning
);
DeviceSuddenStop
();
lastSafeCheckStatus
=
false
;
ok
=
false
;
...
...
@@ -149,7 +149,7 @@ namespace DeviceLibrary
}
else
if
(
isInSuddenDown
)
{
MsgService
.
Add
(
"急停中"
,
MsgLevel
.
alarm
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0134"
,
"急停中"
)
,
MsgLevel
.
alarm
);
ok
=
false
;
}
...
...
@@ -182,4 +182,4 @@ namespace DeviceLibrary
}
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/RobotManage.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -76,7 +76,7 @@ namespace DeviceLibrary
if
(!
IOManager
.
ConnectionIOList
(
new
List
<
string
>()))
{
IsLoadOk
=
false
;
msg
+=
"IO板卡初始化失败"
+
"\n"
;
msg
+=
crc
.
GetString
(
"Res0135"
,
"IO板卡初始化失败"
)
+
"\n"
;
}
//if (!CameraA.LoadCameraConfig("CameraA", out string errmsg))
//{
...
...
@@ -85,7 +85,7 @@ namespace DeviceLibrary
//}
if
(!
HumitureController
.
Init
(
Setting_Init
.
Device_Humiture_Port
))
{
IsLoadOk
=
false
;
msg
+=
"温湿度传感器初始化失败,端口:"
+
Setting_Init
.
Device_Humiture_Port
+
"\n"
;
msg
+=
crc
.
GetString
(
"Res0136"
,
"温湿度传感器初始化失败,端口:"
)
+
Setting_Init
.
Device_Humiture_Port
+
"\n"
;
}
IOManager
.
IOMove
(
IO_Type
.
Device_Led
,
IO_VALUE
.
HIGH
,
Config
);
...
...
@@ -97,7 +97,7 @@ namespace DeviceLibrary
LoadFinishEvent
?.
Invoke
(
IsConfigMode
?
IsConfigMode
:
IsLoadOk
,
msg
);
}
public
static
void
LoadDebug
()
{
LoadFinishEvent
?.
Invoke
(
true
,
"打开调试模式"
);
LoadFinishEvent
?.
Invoke
(
true
,
crc
.
GetString
(
"Res0137"
,
"打开调试模式"
)
);
}
public
static
void
Start
(
MachineSideE
machineSide
)
{
//Init();
...
...
@@ -205,4 +205,4 @@ namespace DeviceLibrary
public
enum
StoreType
{
TypeA
,
TypeB
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/Store/MainMachine _IOMonitor.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -23,11 +23,11 @@ namespace DeviceLibrary
{
if
(
IOValue
(
IO_Type
.
SuddenStop_BTN
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
MsgService
.
Add
(
"按下复位按钮."
,
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0131"
,
"按下复位按钮."
)
,
MsgLevel
.
info
,
ErrInfo
.
ResetBtn
);
}
else
{
MsgService
.
Add
(
"急停未解除,按下复位按钮尝试复位安全继电器."
,
MsgLevel
.
info
,
ErrInfo
.
SuddenStop
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0132"
,
"急停未解除,按下复位按钮尝试复位安全继电器."
)
,
MsgLevel
.
info
,
ErrInfo
.
SuddenStop
);
}
LogUtil
.
info
(
"按下复位按钮"
);
...
...
@@ -40,4 +40,4 @@ namespace DeviceLibrary
}
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/Store/StoreMachine.cs
查看文件 @
ad0410c
using
OnlineStore
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -109,10 +109,10 @@ namespace DeviceLibrary
Msg
=
new
MsgService
(
MachineSide
);
Name
=
machineSide
.
ToString
()
+
"-SISO"
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
StoreMoveInfo
=
new
MoveInfo
(
"进出库调度"
,
machineSide
);
StoreMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0138"
,
"进出库调度"
)
,
machineSide
);
StoreMoveInfo
.
SetStateDelegate
(
StoreState
);
ResetMoveInfo
=
new
MoveInfo
(
"重置"
,
machineSide
);
AIOTMoveInfo
=
new
MoveInfo
(
"出入库测试"
,
machineSide
);
ResetMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0139"
,
"重置"
)
,
machineSide
);
AIOTMoveInfo
=
new
MoveInfo
(
crc
.
GetString
(
"Res0140"
,
"出入库测试"
)
,
machineSide
);
ServerCM
=
new
ServerCommunication
(
this
);
ServerCM
.
InStoreEvent
+=
ServerCM_InStoreEvent1
;
ServerCM
.
OutStoreEvent
+=
ServerCM_OutStoreEvent
;
...
...
@@ -146,7 +146,7 @@ namespace DeviceLibrary
}
else
{
msg
+=
Name
+
"找不到库位配置文件"
+
"\n"
;
msg
+=
Name
+
crc
.
GetString
(
"Res0141"
,
"找不到库位配置文件"
)
+
"\n"
;
}
string
fixpositionConfigFile
=
Path
.
Combine
(
baseDir
,
"StoreConfig\\"
+
machineSide
.
ToString
()
+
"\\fixPositions.csv"
);
if
(
File
.
Exists
(
fixpositionConfigFile
))
...
...
@@ -215,9 +215,9 @@ namespace DeviceLibrary
}
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
{
StoreMoveInfo
.
Name
=
"进出库调度"
;
ResetMoveInfo
.
Name
=
"重置"
;
AIOTMoveInfo
.
Name
=
"出入库测试"
;
StoreMoveInfo
.
Name
=
crc
.
GetString
(
"Res0138"
,
"进出库调度"
)
;
ResetMoveInfo
.
Name
=
crc
.
GetString
(
"Res0139"
,
"重置"
)
;
AIOTMoveInfo
.
Name
=
crc
.
GetString
(
"Res0140"
,
"出入库测试"
)
;
}
private
(
bool
,
string
)
InOut_Axis_interference
(
int
from
,
int
to
)
{
...
...
@@ -231,7 +231,7 @@ namespace DeviceLibrary
return
(
false
,
""
);
}
else
return
(
true
,
"单料门没有打开进出轴无法伸出"
);
return
(
true
,
crc
.
GetString
(
"Res0142"
,
"单料门没有打开进出轴无法伸出"
)
);
return
(
false
,
""
);
}
private
(
bool
,
string
)
Middle_Axis_interference
(
int
from
,
int
to
)
...
...
@@ -242,7 +242,7 @@ namespace DeviceLibrary
if
(
InOut_Axis
.
IsInPosition
(
Config
.
InOut_P1
))
return
(
false
,
""
);
return
(
true
,
"进出轴不在待机点时无法移动旋转轴"
);
return
(
true
,
crc
.
GetString
(
"Res0143"
,
"进出轴不在待机点时无法移动旋转轴"
)
);
}
private
(
bool
,
string
)
UpDown_Axis_interference
(
int
from
,
int
to
)
...
...
@@ -253,7 +253,7 @@ namespace DeviceLibrary
if
(
InOut_Axis
.
IsInPosition
(
Config
.
InOut_P1
))
return
(
false
,
""
);
return
(
true
,
"进出轴不在待机点时无法移动升降轴"
);
return
(
true
,
crc
.
GetString
(
"Res0144"
,
"进出轴不在待机点时无法移动升降轴"
)
);
}
public
volatile
bool
hasAlarm
=
false
;
/// <summary>
...
...
@@ -416,7 +416,7 @@ namespace DeviceLibrary
case
MoveStep
.
H07_HomeReset
:
if
(
IOValue
(
SIO_Type
.
Door_Tray_Check
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"回原时舱门口有料无法继续"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0145"
,
"回原时舱门口有料无法继续"
)
,
MsgLevel
.
alarm
);
}
else
{
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H08_HomeReset
);
...
...
@@ -438,7 +438,7 @@ namespace DeviceLibrary
ResetMoveInfo
.
NextMoveStep
(
MoveStep
.
H11_HomeReset
);
if
(
IOValue
(
SIO_Type
.
Door_Tray_Check
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
Msg
.
add
(
"回原时舱门口有料无法继续"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0145"
,
"回原时舱门口有料无法继续"
)
,
MsgLevel
.
alarm
);
}
else
{
...
...
@@ -486,7 +486,7 @@ namespace DeviceLibrary
bool
lastSafeCheckStatus
=
true
;
bool
SafeCheck
()
{
bool
ok
=
true
;
var
ignorestring
=
"["
+
"已忽略"
+
"]"
;
var
ignorestring
=
"["
+
crc
.
GetString
(
"Res0146"
,
"已忽略"
)
+
"]"
;
if
(
IOValue
(
IO_Type
.
BackDoor_Check
,
MainConfig
).
Equals
(
IO_VALUE
.
LOW
))
{
if
(!
IgnoreSafecheck
)
// && IOValue(IO_Type.NGDoor_Open).Equals(IO_VALUE.HIGH))
...
...
@@ -494,7 +494,7 @@ namespace DeviceLibrary
ok
=
false
;
UserPause
=
true
;
}
Msg
.
add
(
"后维护被打开"
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0147"
,
"后维护被打开"
)
+
(
ok
?
ignorestring
:
""
),
MsgLevel
.
warning
);
}
if
(!
lastSafeCheckStatus
&&
ok
)
{
...
...
@@ -528,7 +528,7 @@ namespace DeviceLibrary
isInSuddenDown
=
IOValue
(
IO_Type
.
SuddenStop_BTN
,
RobotManage
.
Config
).
Equals
(
IO_VALUE
.
LOW
);
if
(
UserPause
)
{
Msg
.
add
(
"系统暂停"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0133"
,
"系统暂停"
)
,
MsgLevel
.
warning
);
DeviceSuddenStop
();
lastSafeCheckStatus
=
false
;
ok
=
false
;
...
...
@@ -537,18 +537,18 @@ namespace DeviceLibrary
else
if
(
isInSuddenDown
)
{
Alarm
(
AlarmType
.
SuddenStop
);
Msg
.
add
(
"急停中"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0134"
,
"急停中"
)
,
MsgLevel
.
alarm
);
ok
=
false
;
}
else
if
(
alarmType
!=
AlarmType
.
None
)
{
{
Msg
.
add
(
"系统需要重置"
,
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
Msg
.
add
(
crc
.
GetString
(
"Res0148"
,
"系统需要重置"
)
,
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
}
}
if
(
AutoInOutTestMode
)
{
Msg
.
add
(
"进出库调试模式"
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0149"
,
"进出库调试模式"
)
,
MsgLevel
.
info
);
//ok = false;
}
...
...
@@ -563,7 +563,7 @@ namespace DeviceLibrary
if
(
AxisManager
.
GetAlarmStatus
(
configMoveAxis
.
DeviceName
,
configMoveAxis
.
GetAxisValue
())
==
1
)
{
Msg
.
add
(
crc
.
GetString
(
configMoveAxis
.
ProName
,
configMoveAxis
.
Explain
)
+
$
"[{configMoveAxis.GetAxisValue()}]:"
+
"运动报警"
,
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
+
crc
.
GetString
(
"Res0150"
,
"运动报警"
)
,
MsgLevel
.
alarm
,
ErrInfo
.
SuddenStop
);
ok
=
false
;
}
}
...
...
@@ -577,4 +577,4 @@ namespace DeviceLibrary
LogUtil
.
info
(
"按下X09忽略"
);
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/Store/StoreMachine_AutoInOutTest.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -18,7 +18,7 @@ namespace DeviceLibrary
errmsg
=
""
;
if
(!
boxTransport
.
IsComplateOrFree
)
{
errmsg
=
"料仓忙碌中,无法启动"
;
errmsg
=
crc
.
GetString
(
"Res0151"
,
"料仓忙碌中,无法启动"
)
;
return
false
;
}
AutoInOutTest
=
true
;
...
...
@@ -35,11 +35,11 @@ namespace DeviceLibrary
{
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
SIO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
5000
))
{
errmsg
=
"收到出库任务,但料叉上有料,无法启动,请检查"
;
errmsg
=
crc
.
GetString
(
"Res0152"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
)
;
}
else
errmsg
=
"收到出库任务,但料叉上有料,无法启动,请检查"
;
errmsg
=
crc
.
GetString
(
"Res0152"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
)
;
return
false
;
}
else
...
...
@@ -51,7 +51,7 @@ namespace DeviceLibrary
}
else
{
errmsg
=
"料仓正在出入库中,无法出库"
;
errmsg
=
crc
.
GetString
(
"Res0153"
,
"料仓正在出入库中,无法出库"
)
;
}
return
true
;
...
...
@@ -110,7 +110,7 @@ namespace DeviceLibrary
}
else
{
Msg
.
add
(
"单料口等待料盘离开."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0154"
,
"单料口等待料盘离开."
)
,
MsgLevel
.
info
);
}
break
;
case
MoveStep
.
StoreIn03
:
...
...
@@ -120,7 +120,7 @@ namespace DeviceLibrary
AIOTMoveInfo
.
log
(
$
"入库料盘已准备好"
);
}
else
{
Msg
.
add
(
"请放入第二盘料."
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0155"
,
"请放入第二盘料."
)
,
MsgLevel
.
warning
);
}
break
;
case
MoveStep
.
StoreIn04
:
...
...
@@ -154,7 +154,7 @@ namespace DeviceLibrary
}
else
{
Msg
.
add
(
"单料口等待料盘离开."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0154"
,
"单料口等待料盘离开."
)
,
MsgLevel
.
info
);
}
break
;
case
MoveStep
.
StoreIn06
:
...
...
@@ -279,4 +279,4 @@ namespace DeviceLibrary
}
}
}
}
}
\ No newline at end of file
DeviceLibrary/theMachine/Store/StoreMachine_Store.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -38,11 +38,10 @@ namespace DeviceLibrary
{
if
(!
boxTransport
.
IgnoreX09
&&
IOMonitor
.
IODebound
(
SIO_Type
.
TrayCheck_Fixture
,
Config
,
IO_VALUE
.
HIGH
,
5000
))
{
Msg
.
add
(
"收到出库任务,但料叉上有料,无法启动,请检查"
,
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
Msg
.
add
(
crc
.
GetString
(
"Res0152"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
),
MsgLevel
.
alarm
,
ErrInfo
.
X09_BoxNotDetect
);
}
else
Msg
.
add
(
"收到出库任务,但料叉上有料,无法启动,请检查"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0152"
,
"收到出库任务,但料叉上有料,无法启动,请检查"
)
,
MsgLevel
.
warning
);
return
;
}
else
...
...
@@ -74,7 +73,7 @@ namespace DeviceLibrary
case
MoveStep
.
StoreIn01
:
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreExecute
))
{
Msg
.
add
(
"服务器连接异常"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
)
,
MsgLevel
.
warning
);
return
;
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreIn02
);
...
...
@@ -92,7 +91,7 @@ namespace DeviceLibrary
}
else
{
Msg
.
add
(
"单料口等待料盘离开."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0154"
,
"单料口等待料盘离开."
)
,
MsgLevel
.
info
);
}
break
;
case
MoveStep
.
StoreIn04
:
...
...
@@ -100,7 +99,7 @@ namespace DeviceLibrary
{
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
InStoreEnd
))
{
Msg
.
add
(
"服务器连接异常"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
)
,
MsgLevel
.
warning
);
return
;
}
StoreMoveInfo
.
log
(
$
"料盘已到达目的地"
);
...
...
@@ -108,7 +107,7 @@ namespace DeviceLibrary
}
else
{
Msg
.
add
(
"等待料盘送到指定位置."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0157"
,
"等待料盘送到指定位置."
)
,
MsgLevel
.
info
);
}
break
;
case
MoveStep
.
StoreIn05
:
...
...
@@ -121,7 +120,7 @@ namespace DeviceLibrary
case
MoveStep
.
StoreOut10
:
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreExecute
))
{
Msg
.
add
(
"服务器连接异常"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
)
,
MsgLevel
.
warning
);
return
;
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut11
);
...
...
@@ -137,7 +136,7 @@ namespace DeviceLibrary
boxTransport
.
Pause
();
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreBoxEnd
))
{
Msg
.
add
(
"服务器连接异常"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
)
,
MsgLevel
.
warning
);
return
;
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut12
);
...
...
@@ -145,7 +144,7 @@ namespace DeviceLibrary
}
else
{
Msg
.
add
(
"等待料盘到达."
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0158"
,
"等待料盘到达."
)
,
MsgLevel
.
info
);
}
break
;
case
MoveStep
.
StoreOut12
:
...
...
@@ -154,13 +153,13 @@ namespace DeviceLibrary
{
if
(
IOValue
(
SIO_Type
.
Door_Tray_Check
,
Config
).
Equals
(
IO_VALUE
.
LOW
))
{
Msg
.
add
(
"单料门口没有检测到出库料盘"
+
","
+
"出库库位号:"
+
StoreMoveInfo
.
MoveParam
.
PosID
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0159"
,
"单料门口没有检测到出库料盘"
)
+
","
+
crc
.
GetString
(
"Res0160"
,
"出库库位号:"
)
+
StoreMoveInfo
.
MoveParam
.
PosID
,
MsgLevel
.
alarm
);
UserPause
=
true
;
return
;
}
if
(!
ServerCM
.
SendStoreState
(
StoreMoveInfo
.
MoveParam
.
PosID
,
StoreStatus
.
OutStoreEnd
))
{
Msg
.
add
(
"服务器连接异常"
,
MsgLevel
.
warning
);
Msg
.
add
(
crc
.
GetString
(
"Res0156"
,
"服务器连接异常"
)
,
MsgLevel
.
warning
);
return
;
}
StoreMoveInfo
.
NextMoveStep
(
MoveStep
.
StoreOut13
);
...
...
@@ -176,10 +175,10 @@ namespace DeviceLibrary
}
else
if
(
StoreMoveInfo
.
IsTimeOut
(
30
))
{
Msg
.
add
(
"等聊单料门料盘被取走"
,
MsgLevel
.
alarm
);
Msg
.
add
(
crc
.
GetString
(
"Res0161"
,
"等聊单料门料盘被取走"
)
,
MsgLevel
.
alarm
);
}
else
Msg
.
add
(
"等聊单料门料盘被取走"
,
MsgLevel
.
info
);
Msg
.
add
(
crc
.
GetString
(
"Res0161"
,
"等聊单料门料盘被取走"
)
,
MsgLevel
.
info
);
break
;
default
:
StoreMoveInfo
.
log
(
$
"未找到对应步骤:{StoreMoveInfo.MoveStep}"
);
...
...
@@ -187,17 +186,17 @@ namespace DeviceLibrary
}
}
string
StoreState
()
{
string
state
=
"空闲中"
;
string
state
=
crc
.
GetString
(
"Res0162"
,
"空闲中"
)
;
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreOut10
)
{
state
=
"出库中"
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
state
=
crc
.
GetString
(
"Res0163"
,
"出库中"
)
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
}
else
if
(
StoreMoveInfo
.
MoveStep
>=
MoveStep
.
StoreIn01
)
{
state
=
"入库中"
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
state
=
crc
.
GetString
(
"Res0164"
,
"入库中"
)
+
":"
+
StoreMoveInfo
.
MoveParam
.
PosID
;
}
return
state
;
}
}
}
}
\ No newline at end of file
DeviceLibrary/userControl/AxisMoveControl.cs
查看文件 @
ad0410c
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Drawing
;
...
...
@@ -78,7 +78,7 @@ namespace DeviceLibrary
{
if
(
axis
==
null
)
{
MessageBox
.
Show
(
"请先选择运动轴"
,
"警告 "
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0165"
,
"请先选择运动轴"
),
crc
.
GetString
(
"Res0166"
,
"警告 "
)
,
MessageBoxButtons
.
OK
,
MessageBoxIcon
.
Error
);
return
false
;
}
...
...
@@ -291,7 +291,7 @@ namespace DeviceLibrary
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0167"
,
"提示"
),
crc
.
GetString
(
"Res0168"
,
"请先输入正确的速度"
)
);
return
;
}
btnAddMove
.
BackColor
=
Color
.
Green
;
...
...
@@ -320,7 +320,7 @@ namespace DeviceLibrary
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0167"
,
"提示"
),
crc
.
GetString
(
"Res0168"
,
"请先输入正确的速度"
)
);
return
;
}
btnDelMove
.
BackColor
=
Color
.
Green
;
...
...
@@ -353,7 +353,7 @@ namespace DeviceLibrary
}
private
void
ReadAxisStatus
()
{
groupBox2
.
Text
=
cmbAxis
.
Text
+
"-"
+
"状态监控"
;
groupBox2
.
Text
=
cmbAxis
.
Text
+
"-"
+
crc
.
GetString
(
"Res0169"
,
"状态监控"
)
;
//【1】更新轴号
short
axisNo
=
SlvAddr
;
if
(
axisNo
<
0
)
...
...
@@ -424,7 +424,7 @@ namespace DeviceLibrary
lbl
.
BackColor
=
Color
.
Red
;
lblAlarmcode
.
Visible
=
true
;
lblAlarmcode
.
ForeColor
=
Color
.
Red
;
lblAlarmcode
.
Text
=
"错误码:"
+
HCBoardManager
.
GetAxErrCode
(
SlvAddr
);
lblAlarmcode
.
Text
=
crc
.
GetString
(
"Res0170"
,
"错误码:"
)
+
HCBoardManager
.
GetAxErrCode
(
SlvAddr
);
}
else
{
...
...
@@ -445,4 +445,4 @@ namespace DeviceLibrary
}
}
}
}
}
\ No newline at end of file
DeviceLibrary/userControl/AxisTipControl.cs
查看文件 @
ad0410c
using
DeviceLibrary
;
using
DeviceLibrary
;
using
HuichuanLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
...
...
@@ -75,11 +75,11 @@ public partial class AxisTipControl : Form
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
if
(
sts
.
ServoOn
<
0
)
{
showToolTip
(
"伺服尚未使能"
,
c
);
showToolTip
(
crc
.
GetString
(
"Res0171"
,
"伺服尚未使能"
)
,
c
);
return
;
}
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
{
showToolTip
(
"伺服警报状态中"
,
c
);
showToolTip
(
crc
.
GetString
(
"Res0172"
,
"伺服警报状态中"
)
,
c
);
return
;
}
readPosition
();
...
...
@@ -137,7 +137,7 @@ public partial class AxisTipControl : Form
void
showToolTip
(
string
txt
,
Control
control
)
{
var
m_ToolTip
=
new
ToolTip
();
m_ToolTip
.
ToolTipIcon
=
ToolTipIcon
.
Warning
;
m_ToolTip
.
ToolTipTitle
=
"无法操作"
;
m_ToolTip
.
ToolTipTitle
=
crc
.
GetString
(
"Res0173"
,
"无法操作"
)
;
m_ToolTip
.
AutoPopDelay
=
0
;
m_ToolTip
.
AutomaticDelay
=
0
;
m_ToolTip
.
InitialDelay
=
0
;
...
...
@@ -167,7 +167,7 @@ public partial class AxisTipControl : Form
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0167"
,
"提示"
),
crc
.
GetString
(
"Res0168"
,
"请先输入正确的速度"
)
);
return
;
}
btnAddMove
.
BackColor
=
Color
.
Green
;
...
...
@@ -200,7 +200,7 @@ public partial class AxisTipControl : Form
int
speed
=
Convert
.
ToInt32
(
comjSpeed
.
Text
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0167"
,
"提示"
),
crc
.
GetString
(
"Res0168"
,
"请先输入正确的速度"
)
);
return
;
}
btnDelMove
.
BackColor
=
Color
.
Green
;
...
...
@@ -222,12 +222,12 @@ public partial class AxisTipControl : Form
AxisSts
sts
=
HCBoardManager
.
GetAxisSts
(
SlvAddr
);
if
(
sts
.
ServoOn
<
0
)
{
showToolTip
(
"伺服尚未使能"
,
(
Control
)
sender
);
showToolTip
(
crc
.
GetString
(
"Res0171"
,
"伺服尚未使能"
)
,
(
Control
)
sender
);
return
false
;
}
if
(
sts
.
ALM
!=
0
||
sts
.
WARN
!=
0
||
sts
.
EMG
!=
0
)
{
showToolTip
(
"伺服警报状态中"
,
(
Control
)
sender
);
showToolTip
(
crc
.
GetString
(
"Res0172"
,
"伺服警报状态中"
)
,
(
Control
)
sender
);
return
false
;
}
return
true
;
...
...
@@ -257,4 +257,3 @@ public partial class AxisTipControl : Form
SetRelList
((
int
)
comjSpeed
.
SelectedItem
);
}
}
DeviceLibrary/userControl/FixtureSizeConfigControl.cs
查看文件 @
ad0410c
using
Newtonsoft.Json
;
using
OnlineStore
;
using
Newtonsoft.Json
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
...
...
@@ -37,7 +38,7 @@ namespace DeviceLibrary
if
(
string
.
IsNullOrWhiteSpace
(
textBox_startcode
.
Text
))
{
MessageBox
.
Show
(
"条码首字母不能为空"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0174"
,
"条码首字母不能为空"
)
);
return
;
}
FixtureConfig
fixtureConfig
=
new
FixtureConfig
();
...
...
@@ -75,8 +76,9 @@ namespace DeviceLibrary
public
override
string
ToString
()
{
return
$
"[{StartCode}]={Width}x{Height}"
+
(
UseActualHeight
?
$
", "
+
"物理厚度"
+
$
":{ActualHeight}"
:
""
)
+
(
AbandonCode
?
", "
+
"自动弃用"
:
""
);
return
$
"[{StartCode}]={Width}x{Height}"
+
(
UseActualHeight
?
$
", "
+
crc
.
GetString
(
"Res0175"
,
"物理厚度"
)+
$
":{ActualHeight}"
:
""
)
+
(
AbandonCode
?
", "
+
crc
.
GetString
(
"Res0176"
,
"自动弃用"
)
:
""
);
}
public
static
bool
GetFixtureHeight
(
int
poswidth
,
int
posheight
,
out
int
FixtureHeight
)
{
FixtureHeight
=
0
;
var
fcc
=
FixtureConfigList
.
Find
(
fc
=>
fc
.
Width
==
poswidth
&&
fc
.
Height
==
posheight
);
...
...
@@ -99,7 +101,8 @@ namespace DeviceLibrary
}
catch
{
}
}
public
static
void
Add
(
FixtureConfig
fixtureConfig
)
{
public
static
void
Add
(
FixtureConfig
fixtureConfig
)
{
var
fcc
=
FixtureConfigList
.
FindIndex
(
fc
=>
fc
.
StartCode
==
fixtureConfig
.
StartCode
);
if
(
fcc
<
0
)
...
...
@@ -123,4 +126,4 @@ namespace DeviceLibrary
}
}
}
}
\ No newline at end of file
LoadCVSLibrary/Program.cs
查看文件 @
ad0410c
...
...
@@ -15,9 +15,9 @@ namespace OnlineStore.LoadCSVLibrary
string
configFile
=
Path
.
Combine
(
baseDir
,
"config\\Config.csv"
);
var
Config
=
new
Robot_Config
(
0
,
""
,
configFile
);
Config
=
(
Robot_Config
)
CSVConfigReader
.
LoadConfig
<
IO_Type
>(
Config
);
var
RConfig
=
new
R_Config
(
0
,
""
,
Path
.
Combine
(
baseDir
,
"config\\
Config_Right
.csv"
));
var
RConfig
=
new
R_Config
(
0
,
""
,
Path
.
Combine
(
baseDir
,
"config\\
Right\\Config
.csv"
));
RConfig
=
(
R_Config
)
CSVConfigReader
.
LoadConfig
<
SIO_Type
>(
RConfig
);
var
LConfig
=
new
L_Config
(
0
,
""
,
Path
.
Combine
(
baseDir
,
"config\\
Config_Left
.csv"
));
var
LConfig
=
new
L_Config
(
0
,
""
,
Path
.
Combine
(
baseDir
,
"config\\
Left\\Config
.csv"
));
LConfig
=
(
L_Config
)
CSVConfigReader
.
LoadConfig
<
SIO_Type
>(
LConfig
);
Store_ConfigBase
device
=
LConfig
;
...
...
LoadCVSLibrary/storeConfig/ConfigItemBase.cs
查看文件 @
ad0410c
...
...
@@ -42,7 +42,16 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
[
CSVAttribute
(
"目标速度"
)]
public
int
TargetSpeed
{
get
;
set
;
}
/// <summary>
/// 目标速度
/// </summary>
[
CSVAttribute
(
"加速时间"
)]
public
int
AddSpeed
{
get
;
set
;
}
/// <summary>
/// 目标速度
/// </summary>
[
CSVAttribute
(
"减速时间"
)]
public
int
DelSpeed
{
get
;
set
;
}
public
string
ConfigStr
{
get
;
set
;
}
public
override
string
ToString
()
...
...
@@ -80,12 +89,6 @@ namespace OnlineStore.LoadCSVLibrary
[
CSVAttribute
(
"目标速度"
)]
public
new
int
TargetSpeed
{
get
;
set
;
}
[
CSVAttribute
(
"加速时间"
)]
public
int
AddSpeed
{
get
;
set
;
}
[
CSVAttribute
(
"减速时间"
)]
public
int
DelSpeed
{
get
;
set
;
}
[
CSVAttribute
(
"原点低速度"
)]
public
int
HomeLowSpeed
{
get
;
set
;
}
...
...
TheMachine/Form1.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
OnlineStore
;
...
...
@@ -99,7 +99,7 @@ namespace TheMachine
AlarmBuzzer
.
BuzzerStateChange
+=
AlarmBuzzer_BuzzerStateChange
;
RobotManage
.
LoadFinishEvent
+=
RobotManage_LoadFinishEvent
;
if
(!
Setting_Init
.
Device_DisableLogWindow
)
AddForm
(
"tab_log"
,
"日志"
,
lc
);
AddForm
(
"tab_log"
,
crc
.
GetString
(
"Res0177"
,
"日志"
)
,
lc
);
RobotManage
.
CameraA
.
camera_event
+=
CameraA_camera_event
;
...
...
@@ -121,7 +121,7 @@ namespace TheMachine
});
}));
ListViewItem
lvi
=
new
ListViewItem
(
new
string
[]
{
""
,
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
),
"设备加载中,请稍后..."
});
ListViewItem
lvi
=
new
ListViewItem
(
new
string
[]
{
""
,
DateTime
.
Now
.
ToString
(
"HH:mm:ss"
),
crc
.
GetString
(
"Res0178"
,
"设备加载中,请稍后..."
)
});
lvi
.
ForeColor
=
Color
.
DarkGreen
;
listViewL
.
Items
.
Add
(
lvi
);
//while (!loadtask.IsCompleted) {
...
...
@@ -170,10 +170,10 @@ namespace TheMachine
const
int
tabpagecount
=
4
;
void
addTablePage
()
{
AddForm
(
"tab_io"
,
"IO调试"
,
ioc
);
AddForm
(
"tab_leftMachine"
,
"左侧料仓"
,
leftMachine
);
AddForm
(
"tab_rightMachine"
,
"右侧料仓"
,
rightMachine
);
AddForm
(
"tab_sc"
,
"通用设置"
,
sc
);
AddForm
(
"tab_io"
,
crc
.
GetString
(
"Form1_tabc_tab_io_Text"
,
"IO调试"
)
,
ioc
);
AddForm
(
"tab_leftMachine"
,
crc
.
GetString
(
"Form1_tabc_tabP1_pnl_gb_left_Text"
,
"左侧料仓"
)
,
leftMachine
);
AddForm
(
"tab_rightMachine"
,
crc
.
GetString
(
"Form1_tabc_tabP1_pnl_gb_right_Text"
,
"右侧料仓"
)
,
rightMachine
);
AddForm
(
"tab_sc"
,
crc
.
GetString
(
"Form1_tabc_tab_sc_Text"
,
"通用设置"
)
,
sc
);
crc
.
LanguageProcess
(
this
);
}
...
...
@@ -186,7 +186,7 @@ namespace TheMachine
RobotManage
.
Stores
.
ForEach
(
s
=>
{
if
(
Config
.
Get
<
bool
>(
$
"Device_{s.MachineSide}_Disable"
))
{
MsgService
.
MSList
[
s
.
MachineSide
].
add
(
"料仓已被禁用"
,
MsgLevel
.
warning
);
MsgService
.
MSList
[
s
.
MachineSide
].
add
(
crc
.
GetString
(
"Res0179"
,
"料仓已被禁用"
)
,
MsgLevel
.
warning
);
MainMachine_ProcessMsgEvent
(
MsgService
.
MSList
[
s
.
MachineSide
].
get
());
}
});
...
...
@@ -244,7 +244,7 @@ namespace TheMachine
{
RobotManage
.
IsConfigMode
=
RobotManage
.
IsConfigMode
?
false
:
true
;
(
sender
as
ToolStripMenuItem
).
Text
=
!
RobotManage
.
IsConfigMode
?
"启用配置模式"
:
"停用配置模式"
;
(
sender
as
ToolStripMenuItem
).
Text
=
!
RobotManage
.
IsConfigMode
?
crc
.
GetString
(
"Res0180"
,
"启用配置模式"
)
:
crc
.
GetString
(
"Res0181"
,
"停用配置模式"
)
;
if
(
RobotManage
.
IsConfigMode
)
...
...
@@ -376,7 +376,7 @@ namespace TheMachine
{
if
(
RobotManage
.
mainMachine
.
IOValue
(
IO_Type
.
SuddenStop_BTN
,
RobotManage
.
Config
).
Equals
(
IO_VALUE
.
LOW
))
{
MsgService
.
Add
(
"急停中,无法启动"
,
MsgLevel
.
warning
);
MsgService
.
Add
(
crc
.
GetString
(
"Res0182"
,
"急停中,无法启动"
)
,
MsgLevel
.
warning
);
MainMachine_ProcessMsgEvent
(
MsgService
.
Get
());
return
;
}
...
...
@@ -408,7 +408,7 @@ namespace TheMachine
private
void
退出
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(
RobotManage
.
isRunning
)
{
MessageBox
.
Show
(
"机器尚在运行,不能退出,请先停止运行."
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0183"
,
"机器尚在运行,不能退出,请先停止运行."
)
);
}
else
{
RobotManage
.
Stop
();
RobotManage
.
ShutDown
();
...
...
@@ -507,14 +507,14 @@ namespace TheMachine
crc
.
LanguageProcess
(
this
,
this
.
GetType
().
Name
);
crc
.
ProcessListItem
(
menuStrip1
.
Items
,
"menuStrip1"
);
listViewL
.
Columns
[
1
].
Text
=
"时间"
;
listViewL
.
Columns
[
2
].
Text
=
"信息"
;
listViewL
.
Columns
[
1
].
Text
=
crc
.
GetString
(
"Res0184"
,
"时间"
)
;
listViewL
.
Columns
[
2
].
Text
=
crc
.
GetString
(
"Form1_tabc_tabP1_Text"
,
"信息"
)
;
stateViewL
.
Columns
[
1
].
Text
=
"模块"
;
stateViewL
.
Columns
[
2
].
Text
=
"步骤"
;
stateViewL
.
Columns
[
3
].
Text
=
"信息"
;
stateViewL
.
Columns
[
1
].
Text
=
crc
.
GetString
(
"Res0185"
,
"模块"
)
;
stateViewL
.
Columns
[
2
].
Text
=
crc
.
GetString
(
"Res0186"
,
"步骤"
)
;
stateViewL
.
Columns
[
3
].
Text
=
crc
.
GetString
(
"Form1_tabc_tabP1_Text"
,
"信息"
)
;
启用调试模式
ToolStripMenuItem
.
Text
=
!
RobotManage
.
IsConfigMode
?
"启用配置模式"
:
"停用配置模式"
;
启用调试模式
ToolStripMenuItem
.
Text
=
!
RobotManage
.
IsConfigMode
?
crc
.
GetString
(
"Res0180"
,
"启用配置模式"
)
:
crc
.
GetString
(
"Res0181"
,
"停用配置模式"
)
;
}
...
...
@@ -536,4 +536,4 @@ namespace TheMachine
crc
.
LanguageChange
();
}
}
}
}
\ No newline at end of file
TheMachine/SettingControl.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
OnlineStore
;
...
...
@@ -87,15 +87,15 @@ namespace TheMachine
if
(!
Visible
)
return
;
lbl_hmdstate
.
Text
=
"当前状态:"
;
lbl_hmdstate
.
Text
=
crc
.
GetString
(
"Res0187"
,
"当前状态:"
)
;
if
(!
HumitureController
.
IsRun
)
{
lbl_hmdstate
.
Text
+=
"未成功连接"
;
lbl_hmdstate
.
Text
+=
crc
.
GetString
(
"Res0188"
,
"未成功连接"
)
;
return
;
}
var
t
=
HumitureController
.
LastData
;
lbl_hmdstate
.
Text
+=
"温度"
+
$
"{t.Temperate}℃, "
+
"湿度"
+
$
"{t.Humidity}%"
;
lbl_hmdstate
.
Text
+=
crc
.
GetString
(
"Res0189"
,
"温度"
)+
$
"{t.Temperate}℃, "
+
crc
.
GetString
(
"Res0190"
,
"湿度"
)
+
$
"{t.Humidity}%"
;
}
}
}
}
\ No newline at end of file
TheMachine/StoreSettingControl.cs
查看文件 @
ad0410c
using
CodeLibrary
;
using
CodeLibrary
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
OnlineStore
;
...
...
@@ -49,7 +49,7 @@ namespace TheMachine
{
if
(
RobotManage
.
isRunning
)
{
MessageBox
.
Show
(
"运行库位校准程序前,需要先停止料仓的运行"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0191"
,
"运行库位校准程序前,需要先停止料仓的运行"
)
);
}
else
{
...
...
@@ -65,4 +65,4 @@ namespace TheMachine
}
}
}
}
\ No newline at end of file
TheMachine/UC/ConfigControl.cs
查看文件 @
ad0410c
using
DeviceLibrary
;
using
OnlineStore
;
using
DeviceLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -215,7 +216,7 @@ namespace TheMachine
{
if
(!
Setting_Init
.
Device_Axis_Manual_Control_AtRunning
&&
Machine
.
isRunning
)
{
MessageBox
.
Show
(
"系统正在运行,不能手动控制伺服"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0210"
,
"系统正在运行,不能手动控制伺服"
)
);
return
;
}
var
cc
=
tableLayoutPanel1
.
Controls
.
Find
(((
Button
)
sender
).
Name
,
false
);
...
...
@@ -293,4 +294,4 @@ namespace TheMachine
Config
=
(
Store_ConfigBase
)
CSVConfigReader
.
LoadConfig
<
SIO_Type
>(
Config
);
}
}
}
}
\ No newline at end of file
TheMachine/UC/UC_LedConfig.cs
查看文件 @
ad0410c
using
DeviceLibrary
;
using
OnlineStore
;
using
DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -71,28 +72,28 @@ namespace TheMachine.UC
Label
label_s
=
new
Label
()
{
Size
=
new
Size
(
200
,
34
),
Text
=
"状态,优先级从大到小"
,
Text
=
crc
.
GetString
(
"Res0220"
,
"状态,优先级从大到小"
)
,
TextAlign
=
ContentAlignment
.
MiddleLeft
};
tableLayoutPanel1
.
Controls
.
Add
(
label_s
,
0
,
0
);
Label
label_g
=
new
Label
()
{
Size
=
new
Size
(
120
,
34
),
Text
=
"绿灯"
,
Text
=
crc
.
GetString
(
"Res0221"
,
"绿灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
};
tableLayoutPanel1
.
Controls
.
Add
(
label_g
,
1
,
0
);
Label
label_y
=
new
Label
()
{
Size
=
new
Size
(
120
,
34
),
Text
=
"黄灯"
,
Text
=
crc
.
GetString
(
"Res0222"
,
"黄灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
};
tableLayoutPanel1
.
Controls
.
Add
(
label_y
,
2
,
0
);
Label
label_r
=
new
Label
()
{
Size
=
new
Size
(
120
,
34
),
Text
=
"红灯"
,
Text
=
crc
.
GetString
(
"Res0223"
,
"红灯"
)
,
TextAlign
=
ContentAlignment
.
MiddleCenter
};
tableLayoutPanel1
.
Controls
.
Add
(
label_r
,
3
,
0
);
...
...
@@ -114,10 +115,10 @@ namespace TheMachine.UC
foreach
(
var
led
in
Led
.
LedColors
.
Keys
)
{
List
<
lightitem
>
lightitems
=
new
List
<
lightitem
>();
lightitems
.
Add
(
new
lightitem
(
"无动作"
,
LedState
.
none
));
lightitems
.
Add
(
new
lightitem
(
"关"
,
LedState
.
off
));
lightitems
.
Add
(
new
lightitem
(
"开"
,
LedState
.
on
));
lightitems
.
Add
(
new
lightitem
(
"闪烁"
,
LedState
.
blink
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0224"
,
"无动作"
)
,
LedState
.
none
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0225"
,
"关"
)
,
LedState
.
off
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0226"
,
"开"
)
,
LedState
.
on
));
lightitems
.
Add
(
new
lightitem
(
crc
.
GetString
(
"Res0227"
,
"闪烁"
)
,
LedState
.
blink
));
var
selit
=
lightitems
.
FindIndex
(
x
=>
x
.
value
==
RobotManage
.
mainMachine
.
MachineLedState
[
key
][
led
]);
ComboBox
comboBox
=
new
ComboBox
();
...
...
@@ -171,9 +172,9 @@ namespace TheMachine.UC
}
if
(
RobotManage
.
mainMachine
.
SaveLedCfg
())
MessageBox
.
Show
(
"保存成功!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0228"
,
"保存成功!"
)
);
else
MessageBox
.
Show
(
"保存失败!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0229"
,
"保存失败!"
)
);
}
}
}
}
\ No newline at end of file
TheMachine/UC/uc_boxdebug.cs
查看文件 @
ad0410c
using
DeviceLibrary
;
using
DeviceLibrary
;
using
log4net
;
using
OnlineStore
;
using
OnlineStore.Common
;
...
...
@@ -66,7 +66,7 @@ namespace TheMachine
timer1
.
Enabled
=
true
;
}
catch
(
Exception
ex
)
{
MessageBox
.
Show
(
"库位表解析错误"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0211"
,
"库位表解析错误"
)
);
LogUtil
.
error
(
Name
+
" "
+
ex
.
ToString
());
}
...
...
@@ -347,14 +347,14 @@ namespace TheMachine
ACStorePosition
ktkPosition
=
Machine
.
StorePosition
[
selectPositionNum
];
JobInfo
jobInfo
=
new
JobInfo
(
"IN_TEST"
,
selectPositionNum
,
ktkPosition
.
BagWidth
,
ktkPosition
.
BagHigh
);
if
(!
Machine
.
StartInStore
(
jobInfo
,
Machine
.
AIOTMoveInfo
))
{
MessageBox
.
Show
(
"料盘没有到位,无法手动入库"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0212"
,
"料盘没有到位,无法手动入库"
)
);
return
;
}
LogUtil
.
info
(
$
"手动入库:{selectPositionNum}"
);
}
else
{
MessageBox
.
Show
(
"请先启动料仓!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0213"
,
"请先启动料仓!"
)
);
}
}
...
...
@@ -377,7 +377,7 @@ namespace TheMachine
}
else
{
MessageBox
.
Show
(
"请先启动料仓!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0213"
,
"请先启动料仓!"
)
);
}
}
...
...
@@ -406,13 +406,13 @@ namespace TheMachine
{
btnOutStore
.
Enabled
=
false
;
btnInStore
.
Enabled
=
false
;
btn_autoinout
.
Text
=
"停止自动库位测试"
;
btn_autoinout
.
Text
=
crc
.
GetString
(
"Res0214"
,
"停止自动库位测试"
)
;
}
else
{
btnOutStore
.
Enabled
=
true
;
btnInStore
.
Enabled
=
true
;
btn_autoinout
.
Text
=
"自动库位测试"
;
btn_autoinout
.
Text
=
crc
.
GetString
(
"Res0215"
,
"自动库位测试"
)
;
}
}
private
void
dataGridView1_CellContentClick
(
object
sender
,
DataGridViewCellEventArgs
e
)
...
...
@@ -447,7 +447,7 @@ namespace TheMachine
if
(
Machine
.
AutoInOutTest
)
{
Machine
.
StopAutoInOutTest
();
MessageBox
.
Show
(
"自动出入库过程会再料盘送至出口后自动停止."
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0216"
,
"自动出入库过程会再料盘送至出口后自动停止."
)
);
return
;
}
...
...
@@ -456,11 +456,11 @@ namespace TheMachine
if
(!
Machine
.
IOValue
(
SIO_Type
.
Door_Tray_Check
,
Config
).
Equals
(
IO_VALUE
.
HIGH
))
{
MessageBox
.
Show
(
"入库料盘没有准备好,请先点击[上料准备],无法启动"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0217"
,
"入库料盘没有准备好,请先点击[上料准备],无法启动"
)
);
return
;
}
DialogResult
res
=
MessageBox
.
Show
(
"确定开始自动库位测试?\n请确保料仓库位全部为空."
,
"提示"
,
MessageBoxButtons
.
YesNo
);
DialogResult
res
=
MessageBox
.
Show
(
crc
.
GetString
(
"Res0218"
,
"确定开始自动库位测试?\n请确保料仓库位全部为空."
),
crc
.
GetString
(
"Res0167"
,
"提示"
)
,
MessageBoxButtons
.
YesNo
);
if
(
res
==
DialogResult
.
No
)
return
;
int
posindex
=
Machine
.
PositionNumList
.
IndexOf
(
cmbPosition
.
Text
);
...
...
@@ -470,11 +470,11 @@ namespace TheMachine
MessageBox
.
Show
(
errmsg
);
return
;
}
(
sender
as
Button
).
Text
=
"停止自动库位测试!"
;
(
sender
as
Button
).
Text
=
crc
.
GetString
(
"Res0219"
,
"停止自动库位测试!"
)
;
}
else
{
MessageBox
.
Show
(
"请先启动料仓!"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0213"
,
"请先启动料仓!"
)
);
}
}
...
...
@@ -491,4 +491,4 @@ namespace TheMachine
}
}
}
}
\ No newline at end of file
TheMachine/UCStoreMachine.cs
查看文件 @
ad0410c
using
ConfigHelper
;
using
ConfigHelper
;
using
DeviceLibrary
;
using
OnlineStore
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
...
...
@@ -37,8 +38,12 @@ namespace TheMachine
bd
.
Config
=
Machine
.
Config
;
sio
.
Config
=
Machine
.
Config
;
Common
.
AlertListViewSet
(
listView
);
this
.
Tag
=
"not"
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
}
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
{
}
private
void
Machine_ProcessMsgEvent
(
List
<
Msg
>
msg
)
{
if
(
msg
==
null
)
...
...
@@ -116,10 +121,10 @@ namespace TheMachine
private
void
UCStoreMachine_Load
(
object
sender
,
EventArgs
e
)
{
Config
.
PropertyBind
(
$
"Device_{Machine.MachineSide}_Disable"
,
checkBox_disable
,
"Checked"
,
"CheckedChanged"
);
AddForm
(
"tab_sio"
,
"IO调试"
,
sio
);
AddForm
(
"tab_axis"
,
"伺服调试"
,
ac
);
AddForm
(
"tab_store"
,
"库位调试"
,
bd
);
AddForm
(
"tab_setting"
,
"相关设置"
,
sc
);
AddForm
(
"tab_sio"
,
crc
.
GetString
(
"Form1_tabc_tab_io_Text"
,
"IO调试"
)
,
sio
);
AddForm
(
"tab_axis"
,
crc
.
GetString
(
"Res0192"
,
"伺服调试"
)
,
ac
);
AddForm
(
"tab_store"
,
crc
.
GetString
(
"Res0193"
,
"库位调试"
)
,
bd
);
AddForm
(
"tab_setting"
,
crc
.
GetString
(
"Res0194"
,
"相关设置"
)
,
sc
);
}
private
void
AddForm
(
string
id
,
string
text
,
UserControl
form
)
...
...
@@ -160,7 +165,7 @@ namespace TheMachine
if
(!
Machine
.
isRunning
)
{
btn_stop
.
Enabled
=
false
;
btn_run
.
Text
=
"启动"
;
btn_run
.
Text
=
crc
.
GetString
(
"Res0195"
,
"启动"
)
;
btn_run
.
BackColor
=
Color
.
Transparent
;
return
;
}
...
...
@@ -168,13 +173,13 @@ namespace TheMachine
if
(
e
)
{
//Machine.UserPause = true;
(
btn_run
as
Button
).
Text
=
"恢复运行"
;
(
btn_run
as
Button
).
Text
=
crc
.
GetString
(
"Res0196"
,
"恢复运行"
)
;
(
btn_run
as
Button
).
BackColor
=
Color
.
LightGreen
;
}
else
{
//Machine.UserPause = false;
(
btn_run
as
Button
).
Text
=
"暂停运行"
;
(
btn_run
as
Button
).
Text
=
crc
.
GetString
(
"Res0197"
,
"暂停运行"
)
;
(
btn_run
as
Button
).
BackColor
=
Color
.
Yellow
;
}
}
...
...
@@ -184,7 +189,7 @@ namespace TheMachine
{
if
(
Machine
.
IOValue
(
IO_Type
.
SuddenStop_BTN
,
RobotManage
.
Config
).
Equals
(
IO_VALUE
.
LOW
))
{
Machine
.
Msg
.
add
(
"急停中,无法启动"
,
MsgLevel
.
warning
);
Machine
.
Msg
.
add
(
crc
.
GetString
(
"Res0182"
,
"急停中,无法启动"
)
,
MsgLevel
.
warning
);
Machine_ProcessMsgEvent
(
Machine
.
Msg
.
get
()[
Machine
.
MachineSide
]);
return
;
}
...
...
@@ -218,4 +223,4 @@ namespace TheMachine
//btn_run.BackColor = Color.Transparent;
}
}
}
}
\ No newline at end of file
TheMachine/positionTool/FrmPositionTool.cs
查看文件 @
ad0410c
using
DeviceLibrary
;
using
OnlineStore
;
using
DeviceLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.DeviceLibrary
;
using
OnlineStore.LoadCSVLibrary
;
...
...
@@ -19,7 +20,7 @@ namespace OnlineStore.ACSingleStore
{
public
partial
class
FrmPositionTool
:
Form
{
private
string
LogName
=
"升降轴位置调试:"
;
private
string
LogName
=
crc
.
GetString
(
"Res0198"
,
"升降轴位置调试:"
)
;
AxisBean
UpDown_Axis
;
string
iotype
=
""
;
StoreMachine
Machine
;
...
...
@@ -65,7 +66,7 @@ namespace OnlineStore.ACSingleStore
formStatus
(
isOn
);
if
(
isOn
)
timer1
.
Start
();
ioStatusControl1
.
IOName
=
"检测信号"
;
ioStatusControl1
.
IOName
=
crc
.
GetString
(
"Res0199"
,
"检测信号"
)
;
}
delegate
void
ShowLogProDelegate
(
string
msg
,
Color
color
);
...
...
@@ -149,7 +150,7 @@ namespace OnlineStore.ACSingleStore
if
(
speed
<=
(
0
))
{
MessageBox
.
Show
(
"请输入正确的速度"
);
MessageBox
.
Show
(
crc
.
GetString
(
"Res0200"
,
"请输入正确的速度"
)
);
txtSpeed
.
Focus
();
return
;
}
...
...
@@ -263,7 +264,7 @@ namespace OnlineStore.ACSingleStore
}
LogUtil
.
info
(
LogName
+
"伺服已停止运动,停止定时器,记录数据"
);
List
<
string
>
strList
=
new
List
<
string
>();
strList
.
Add
(
"编号,标准位置,升降轴库位入料高点P3,升降轴库位入料低点P4"
);
strList
.
Add
(
crc
.
GetString
(
"Res0201"
,
"编号,标准位置,升降轴库位入料高点P3,升降轴库位入料低点P4"
)
);
int
index
=
1
;
foreach
(
int
p
in
PositionList
)
{
...
...
@@ -299,7 +300,7 @@ namespace OnlineStore.ACSingleStore
var
homests
=
AxisManager
.
GetHomeEndStatus
(
PortName
,
SlvAddr
);
var
servisop
=
AxisManager
.
ServerOnStatus
(
PortName
,
SlvAddr
);
int
moveS
=
AxisManager
.
GetBusyStatus
(
PortName
,
SlvAddr
);
label_servosts
.
Text
=
"伺服状态:"
+(
servisop
?
"已使能"
:
"未使能"
)+
","
+
"原点状态:"
+(
homests
==
3
?
"已完成"
:
"未完成"
)
+
","
+
"忙碌状态:"
+(
moveS
==
1
?
"忙碌中"
:
"空闲中"
);
label_servosts
.
Text
=
crc
.
GetString
(
"Res0202"
,
"伺服状态:"
)+(
servisop
?
crc
.
GetString
(
"Res0203"
,
"已使能"
)
:
crc
.
GetString
(
"Res0204"
,
"未使能"
))+
","
+
crc
.
GetString
(
"Res0205"
,
"原点状态:"
)+(
homests
==
3
?
crc
.
GetString
(
"Res0206"
,
"已完成"
)
:
crc
.
GetString
(
"Res0207"
,
"未完成"
))
+
","
+
crc
.
GetString
(
"Res0208"
,
"忙碌状态:"
)+(
moveS
==
1
?
crc
.
GetString
(
"Res0209"
,
"忙碌中"
)
:
crc
.
GetString
(
"Res0162"
,
"空闲中"
)
);
ioStatusControl1
.
IOValue
=
(
int
)
GetSingleValue
();
ioStatusControl1
.
ShowData
();
...
...
@@ -333,4 +334,4 @@ namespace OnlineStore.ACSingleStore
}
}
}
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论