Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
VerticalStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e178b7d4
由
LN
编写于
2020-06-17 17:10:55 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改垂直货柜配置
1 个父辈
4be59287
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
34 个修改的文件
包含
553 行增加
和
645 行删除
doc/SO479垂直循环货柜IO配置.xlsx
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/StoreConfig/StoreConfig.csv
source/DeviceLibrary/acVerticalStore/AxisBean.cs
source/DeviceLibrary/acVerticalStore/DoorBean.cs
source/DeviceLibrary/acVerticalStore/StoreManager.cs
source/DeviceLibrary/acVerticalStore/VerticalStoreBean.cs
source/DeviceLibrary/acVerticalStore/VerticalStoreBean_InOut.cs
source/DeviceLibrary/device/IO/AIManager.cs
source/DeviceLibrary/device/IO/AIOBOX/AIOAIManager.cs
source/DeviceLibrary/device/IO/KangNaiDe/AITcpClient.cs
source/DeviceLibrary/device/IO/KangNaiDe/KNDAIManager.cs
source/DeviceLibrary/device/IO/KangNaiDe/KNDManager.cs
source/DeviceLibrary/device/IO/KangNaiDe/MasterTcpClient.cs
source/DeviceLibrary/device/led/BaseLedManager.cs
source/DeviceLibrary/store/InOutParam.cs
source/DeviceLibrary/store/KTK_DeviceBase.cs
source/DeviceLibrary/store/KTK_Store.cs
source/DeviceLibrary/store/StoreMoveP.cs
source/DeviceLibrary/store/StoreStep.cs
source/DeviceLibrary/store/model/StoreMoveInfo.cs
source/LoadCVSLibrary/position/VerticalPosition.cs
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/LoadCVSLibrary/storeConfig/config/StoreType.cs
source/LoadCVSLibrary/storeConfig/config/VerticalStoreConfig.cs
source/VerticalStoreClinet/App.config
source/VerticalStoreClinet/FrmIOStatus.Designer.cs
source/VerticalStoreClinet/FrmIOStatus.cs
source/VerticalStoreClinet/FrmStoreBox.Designer.cs
source/VerticalStoreClinet/FrmStoreBox.cs
source/VerticalStoreClinet/useControl/AxisMoveControl.cs
source/VerticalStoreClinet/记录.txt
doc/SO479垂直循环货柜IO配置.xlsx
查看文件 @
e178b7d
此文件类型无法预览
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
e178b7d
...
@@ -65,21 +65,20 @@
...
@@ -65,21 +65,20 @@
</Reference>
</Reference>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Include="acVerticalStore\AxisBean.cs" />
<Compile Include="acVerticalStore\DoorBean.cs" />
<Compile Include="acVerticalStore\VerticalStoreBean.cs" />
<Compile Include="acVerticalStore\VerticalStoreBean.cs" />
<Compile Include="acVerticalStore\VerticalStoreBean_InOut.cs" />
<Compile Include="acVerticalStore\VerticalStoreBean_InOut.cs" />
<Compile Include="acVerticalStore\StoreManager.cs" />
<Compile Include="acVerticalStore\StoreManager.cs" />
<Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="device\IO\IOManager.cs" />
<Compile Include="device\IO\IOManager.cs" />
<Compile Include="device\led\BaseLedManager.cs" />
<Compile Include="device\led\BaseLedManager.cs" />
<Compile Include="device\led\LEDColorArtNet.cs" />
<Compile Include="device\led\LEDColorArtNet.cs" />
<Compile Include="store\StoreMoveP.cs" />
<Compile Include="store\StoreAlarm.cs">
<Compile Include="store\StoreAlarm.cs">
<SubType>Code</SubType>
<SubType>Code</SubType>
</Compile>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\model\AxisAlarmInfo.cs" />
<Compile Include="store\KTK_DeviceBase.cs" />
<Compile Include="store\InOutParam.cs">
<Compile Include="store\InOutParam.cs">
<SubType>Code</SubType>
<SubType>Code</SubType>
</Compile>
</Compile>
...
...
source/DeviceLibrary/StoreConfig/StoreConfig.csv
查看文件 @
e178b7d
...
@@ -3,12 +3,13 @@
...
@@ -3,12 +3,13 @@
AXIS,(轴一)料斗旋转轴,Middle_Axis,1,COM1,,,,250,80,80,80,60,50,10,1000,0,0
AXIS,(轴一)料斗旋转轴,Middle_Axis,1,COM1,,,,250,80,80,80,60,50,10,1000,0,0
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.21#16,,,,,,,,,,,,,,
PRO,IO模块对应的DI数量,IO_DILength,192.168.200.21#16,,,,,,,,,,,,,,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.21#16,,,,,,,,,,,,,,
PRO,模块对应的DO数量,IO_DOLength,192.168.200.21#16,,,,,,,,,,,,,,
PRO,Led控制器IP,LED_IP,192.168.200.192,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,192.168.200.21,急停,X01,X01,,,,,,,,,,
DI,急停,SuddenStop_BTN,0,192.168.200.21,急停,X01,X01,,,,,,,,,,
DI,复位,Reset_BTN,1,192.168.200.21,复位,X02,X02,,,,,,,,,,
DI,复位,Reset_BTN,1,192.168.200.21,复位,X02,X02,,,,,,,,,,
DI,安全光栅,SafetyLightCurtains,2,192.168.200.21,安全光栅,X03,X03,,,,,,,,,,
DI,安全光栅,SafetyLightCurtains,2,192.168.200.21,安全光栅,X03,X03,,,,,,,,,,
DI,升降门上升
端,Door_Up,3,192.168.200.21,升降门上升
端,X04,X04,,,,,,,,,,
DI,升降门上升
/打开端,Door_Up,3,192.168.200.21,升降门上升/打开
端,X04,X04,,,,,,,,,,
DI,升降门下降
端,Door_Down,4,192.168.200.21,升降门下降
端,X05,X05,,,,,,,,,,
DI,升降门下降
/关闭端,Door_Down,4,192.168.200.21,升降门下降/关闭
端,X05,X05,,,,,,,,,,
,链轮计数信号,,5,192.168.200.21,链轮计数信号,X06,X06,,,,,,,,,,
,链轮计数信号,,5,192.168.200.21,链轮计数信号,X06,X06,,,,,,,,,,
,,,6,192.168.200.21,,X07,X07,,,,,,,,,,
,,,6,192.168.200.21,,X07,X07,,,,,,,,,,
,,,7,192.168.200.21,,X08,X08,,,,,,,,,,
,,,7,192.168.200.21,,X08,X08,,,,,,,,,,
...
@@ -27,9 +28,9 @@ DO,待机指示灯,RunSign_HddLed,2,192.168.200.21,待机指示灯,Y03,Y03,,,,,,,,,,
...
@@ -27,9 +28,9 @@ DO,待机指示灯,RunSign_HddLed,2,192.168.200.21,待机指示灯,Y03,Y03,,,,,,,,,,
DO,报警蜂鸣器,Alarm_Buzzer,3,192.168.200.21,报警蜂鸣器,Y04,Y04,,,,,,,,,,
DO,报警蜂鸣器,Alarm_Buzzer,3,192.168.200.21,报警蜂鸣器,Y04,Y04,,,,,,,,,,
DO,设备运转ON,Run_Signal,4,192.168.200.21,设备运转ON,Y05,Y05,,,,,,,,,,
DO,设备运转ON,Run_Signal,4,192.168.200.21,设备运转ON,Y05,Y05,,,,,,,,,,
DO,料斗伺服刹车ON,Axis_Brake,5,192.168.200.21,料斗伺服刹车ON,Y06,Y06,,,,,,,,,,
DO,料斗伺服刹车ON,Axis_Brake,5,192.168.200.21,料斗伺服刹车ON,Y06,Y06,,,,,,,,,,
DO,升降门刹车ON,
Camera_Led
,6,192.168.200.21,升降门刹车ON,Y07,Y07,,,,,,,,,,
DO,升降门刹车ON,
Door_Break
,6,192.168.200.21,升降门刹车ON,Y07,Y07,,,,,,,,,,
DO,升降门
电机上升,Door_Up,7,192.168.200.21,升降门电机上升
,Y08,Y08,,,,,,,,,,
DO,升降门
上升/打开端,Door_Up,7,192.168.200.21,升降门上升/打开端
,Y08,Y08,,,,,,,,,,
DO,升降门
电机下降,Door_Down,8,192.168.200.21,升降门电机下降
,Y09,Y09,,,,,,,,,,
DO,升降门
下降/关闭端,Door_Down,8,192.168.200.21,升降门下降/关闭端
,Y09,Y09,,,,,,,,,,
DO,设备照明ON,Device_Led,9,192.168.200.21,设备照明ON,Y10,Y10,,,,,,,,,,
DO,设备照明ON,Device_Led,9,192.168.200.21,设备照明ON,Y10,Y10,,,,,,,,,,
,,,10,192.168.200.21,,Y11,Y11,,,,,,,,,,
,,,10,192.168.200.21,,Y11,Y11,,,,,,,,,,
,,,11,192.168.200.21,,Y12,Y12,,,,,,,,,,
,,,11,192.168.200.21,,Y12,Y12,,,,,,,,,,
...
@@ -49,4 +50,3 @@ PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,,,,,,,,,
...
@@ -49,4 +50,3 @@ PRO,旋转轴(轴1)P2速度,MiddleAxis_P2_Speed,120,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,,,,,,,,
PRO,设备是否处于调试状态(1=调试,0=正常),IsInDebug,0,,,,,,,,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,,,,,,,,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,
\ No newline at end of file
\ No newline at end of file
source/DeviceLibrary/acVerticalStore/AxisBean.cs
0 → 100644
查看文件 @
e178b7d
using
DeviceLib
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AxisBean
{
public
ConfigMoveAxis
Config
=
null
;
public
static
int
TimeoutInterval
=
500
;
/// <summary>
/// 正常工作过程中判断位置是否到达时使用
/// </summary>
public
int
LastPosition
=
0
;
public
string
AxisName
;
public
AxisBean
(
ConfigMoveAxis
axisConfig
,
string
deviceName
)
{
this
.
Config
=
axisConfig
;
AxisName
=
deviceName
+
" "
+
Config
.
Explain
+
"["
+
Config
.
DeviceName
+
"-"
+
Config
.
GetAxisValue
()
+
"]"
;
}
private
bool
IsIntSlvBlock
=
false
;
public
bool
Open
(
bool
isCheck
,
out
string
Msg
)
{
IOManager
.
IOMove
(
Config
.
Axis_Run_DO
,
IO_VALUE
.
HIGH
);
Msg
=
""
;
string
portName
=
Config
.
DeviceName
;
int
slvAddr
=
Config
.
GetAxisValue
();
//打开 轴
int
bro
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ACBaudRate
);
ACServerManager
.
OpenPort
(
Config
.
DeviceName
,
bro
);
Thread
.
Sleep
(
50
);
//初始化
if
(!
IsIntSlvBlock
)
{
ACServerManager
.
InitSlvAddr
(
portName
,
slvAddr
,
Config
.
TargetSpeed
,
Config
.
AddSpeed
,
Config
.
DelSpeed
);
Thread
.
Sleep
(
100
);
}
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
Thread
.
Sleep
(
50
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
Thread
.
Sleep
(
1000
);
//打开所有轴
if
(
isCheck
)
{
if
(!
OpenAxis
(
out
Msg
))
{
return
false
;
}
}
IOManager
.
IOMove
(
Config
.
Axis_Brake_DO
,
IO_VALUE
.
HIGH
);
IsIntSlvBlock
=
true
;
return
true
;
}
/// <summary>
/// 打开所有轴
/// </summary>
/// <returns></returns>
private
bool
OpenAxis
(
out
string
msg
)
{
msg
=
""
;
//判断轴是否正常
string
portName
=
Config
.
DeviceName
;
int
slvAddr
=
Config
.
GetAxisValue
();
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
{
LogUtil
.
info
(
AxisName
+
"成功打开"
);
}
else
{
//清理报警,再重新打开一次
LogUtil
.
info
(
AxisName
+
"第一次打开失败,先清理一下报警,再重新打开一次"
);
ACServerManager
.
AlarmClear
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
1200
);
ACServerManager
.
ServoOn
(
portName
,
slvAddr
);
System
.
Threading
.
Thread
.
Sleep
(
100
);
if
(
ACServerManager
.
ServerOnStatus
(
portName
,
slvAddr
))
{
LogUtil
.
info
(
AxisName
+
"清理报警后重新打卡轴成功:"
+
Config
.
Explain
);
}
else
{
ACServerManager
.
ServoOff
(
portName
,
slvAddr
);
msg
=
"打开轴"
+
Config
.
Explain
+
"失败 "
;
LogUtil
.
info
(
AxisName
+
msg
);
return
false
;
}
}
return
true
;
}
public
void
ServoOff
()
{
LogUtil
.
info
(
"ServoOff【"
+
AxisName
+
"】"
);
IOManager
.
IOMove
(
Config
.
Axis_Brake_DO
,
IO_VALUE
.
LOW
);
ACServerManager
.
ServoOff
(
Config
.
DeviceName
,
Config
.
GetAxisValue
());
IOManager
.
IOMove
(
Config
.
Axis_Run_DO
,
IO_VALUE
.
LOW
);
}
public
void
HomeMove
(
StoreMoveInfo
MoveInfo
)
{
Config
.
TargetPosition
=
0
;
LogUtil
.
info
(
AxisName
+
"speed["
+
Config
.
TargetSpeed
+
"]开始原点返回"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
true
));
ACServerManager
.
HomeMove
(
Config
.
DeviceName
,
(
short
)
Config
.
GetAxisValue
(),
Config
.
HomeHighSpeed
);
}
public
void
AbsMove
(
StoreMoveInfo
MoveInfo
,
int
targetPosition
,
int
targetSpeed
)
{
if
(
MoveInfo
==
null
)
{
AbsMove
(
targetPosition
,
targetSpeed
);
}
else
{
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitAxis
(
Config
,
targetPosition
,
targetSpeed
));
Config
.
TargetPosition
=
targetPosition
;
ACServerManager
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
}
}
public
static
bool
ACAxisMoveIsEnd
(
StoreMoveInfo
MoveInfo
,
ConfigMoveAxis
axis
,
int
targetPosition
,
int
targetSpeed
,
out
string
msg
)
{
msg
=
""
;
string
deviceName
=
axis
.
DeviceName
;
short
axisNo
=
axis
.
GetAxisValue
();
bool
isOk
=
ACServerManager
.
GetBusyStatus
(
deviceName
,
axisNo
).
Equals
(
0
);
int
outCount
=
ACServerManager
.
GetActualtPosition
(
deviceName
,
axisNo
);
int
errorCount
=
Math
.
Abs
(
outCount
-
targetPosition
);
if
(
isOk
)
{
if
(
errorCount
<=
axis
.
CanErrorCountMax
)
{
return
true
;
}
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,重新开始运动,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
ACServerManager
.
SuddenStop
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
ACServerManager
.
AbsMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
targetPosition
,
targetSpeed
);
MoveInfo
.
CanWhileCount
--;
}
else
{
msg
=
" "
+
MoveInfo
.
MoveStep
+
MoveInfo
.
Name
+
axis
.
DisplayStr
+
",目标位置["
+
targetPosition
+
"]当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
,
600
);
}
}
return
false
;
}
public
static
bool
HomeMoveIsEnd
(
StoreMoveInfo
MoveInfo
,
ConfigMoveAxis
axis
,
out
string
msg
)
{
msg
=
""
;
if
(
ACServerManager
.
IsHomeMoveEnd
(
axis
.
DeviceName
,
axis
.
GetAxisValue
()))
{
//原点完成并且位置=0
int
outCount
=
ACServerManager
.
GetActualtPosition
(
axis
.
DeviceName
,
axis
.
GetAxisValue
());
int
errorCount
=
Math
.
Abs
(
outCount
);
if
(
errorCount
<=
axis
.
CanErrorCountMax
)
{
return
true
;
}
//判断是否需要重新运动
if
(
MoveInfo
.
CanWhileCount
>
0
)
{
LogUtil
.
error
(
MoveInfo
.
Name
+
axis
.
DisplayStr
+
"收到原点完成信号,当前位置["
+
outCount
+
"],重新回原点,剩余["
+
MoveInfo
.
CanWhileCount
+
"]次"
);
//LogUtil.error( StoreName + moveAxis.DisplayStr + "重新回原点");
ACServerManager
.
HomeMove
(
axis
.
DeviceName
,
axis
.
GetAxisValue
(),
axis
.
HomeHighSpeed
,
true
);
MoveInfo
.
CanWhileCount
--;
}
else
{
msg
=
MoveInfo
.
Name
+
" "
+
MoveInfo
.
MoveType
+
axis
.
DisplayStr
+
",收到原点完成信号,当前位置["
+
outCount
+
"],误差过大,需要报警"
;
LogUtil
.
error
(
msg
);
}
}
return
false
;
}
public
int
GetAclPosition
()
{
int
p
=
ACServerManager
.
GetActualtPosition
(
Config
.
DeviceName
,
Config
.
GetAxisValue
());
return
p
;
}
public
bool
IsInPosition
(
int
targetP
)
{
int
currp
=
GetAclPosition
();
int
chaz
=
targetP
-
currp
;
if
(
Math
.
Abs
(
chaz
)
<
Config
.
CanErrorCountMax
)
{
return
true
;
}
return
false
;
}
/// <summary>
/// 绝对运动至点,不等待结果
/// </summary>
private
void
AbsMove
(
int
targetPos
,
double
targetSpeed
)
{
if
(
targetPos
.
Equals
(-
1
))
{
return
;
}
LastPosition
=
-
1
;
if
(
targetSpeed
>
Config
.
TargetSpeed
||
targetSpeed
<=
0
)
{
targetSpeed
=
Config
.
TargetSpeed
;
}
//小于1,表示是目标速度的百分比
else
if
(
targetSpeed
<=
1
)
{
targetSpeed
=
Config
.
TargetSpeed
*
targetSpeed
;
}
ACServerManager
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPos
,
(
int
)
targetSpeed
);
}
public
void
SuddenStop
()
{
ACServerManager
.
SuddenStop
(
Config
.
DeviceName
,
Config
.
GetAxisValue
());
}
}
}
source/DeviceLibrary/acVerticalStore/DoorBean.cs
0 → 100644
查看文件 @
e178b7d
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
DoorBean
{
public
static
bool
IsRun
=
false
;
private
static
string
LastMoveDO
=
""
;
private
static
string
LastCheckDI
=
""
;
internal
static
DateTime
LastEndTime
=
DateTime
.
Now
;
public
static
void
Stop
()
{
if
(
IsRun
)
{
IsRun
=
false
;
}
}
private
static
bool
Start
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
if
(
IsRun
)
{
LogUtil
.
error
(
"启动["
+
moveDO
+
"] ["
+
checkDI
+
"] 失败"
);
return
false
;
}
IsRun
=
true
;
Task
.
Factory
.
StartNew
(
delegate
{
WriteAndWait
(
moveDO
,
checkDI
,
timeOutMS
);
});
return
true
;
}
private
static
string
WriteAndWait
(
string
moveDO
,
string
checkDI
,
int
timeOutMS
=
30000
)
{
LastMoveDO
=
moveDO
;
LastCheckDI
=
checkDI
;
LogUtil
.
debug
(
"写入信号:"
+
moveDO
+
",等待信号:"
+
checkDI
+
""
);
if
(
moveDO
.
Equals
(
IO_Type
.
Door_Up
))
{
IOManager
.
IOMove
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
);
}
else
{
IOManager
.
IOMove
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
);
}
IOManager
.
IOMove
(
moveDO
,
IO_VALUE
.
HIGH
);
Thread
.
Sleep
(
50
);
IsRun
=
true
;
DateTime
startTime
=
DateTime
.
Now
;
string
result
=
""
;
bool
isStop
=
false
;
while
(
true
)
{
Thread
.
Sleep
(
50
);
TimeSpan
span
=
DateTime
.
Now
-
startTime
;
if
(!
IsRun
)
{
isStop
=
true
;
result
=
"手动停止"
;
}
else
if
(
span
.
TotalMilliseconds
>
timeOutMS
)
{
isStop
=
true
;
result
=
"转动超时"
;
}
//判断Buzy及位置是否结束
else
if
(
IOManager
.
IOValue
(
checkDI
).
Equals
(
IO_VALUE
.
HIGH
))
{
isStop
=
true
;
}
if
(
isStop
)
{
if
(
result
.
Equals
(
""
))
{
LogUtil
.
info
(
"停止运动:"
+
result
+
" ["
+
moveDO
+
"] ["
+
checkDI
+
"] "
);
}
else
{
LogUtil
.
info
(
"["
+
moveDO
+
"] ["
+
checkDI
+
"] 停止运动:"
+
result
+
" "
+
moveDO
);
}
LastEndTime
=
DateTime
.
Now
;
IOManager
.
IOMove
(
moveDO
,
IO_VALUE
.
LOW
);
IsRun
=
false
;
return
result
;
}
}
}
private
static
bool
UseDoor
=
true
;
public
static
bool
StartOpen
(
StoreMoveInfo
moveInfo
)
{
if
(!
UseDoor
)
{
return
false
;
}
//如果门已打开直接返回
if
(
IOManager
.
IOValue
(
IO_Type
.
Door_Down
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Door_Up
).
Equals
(
IO_VALUE
.
LOW
))
{
return
true
;
}
if
(
moveInfo
!=
null
)
{
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
HIGH
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
LOW
));
}
return
Start
(
IO_Type
.
Door_Down
,
IO_Type
.
Door_Down
);
}
public
static
bool
StartClose
(
StoreMoveInfo
moveInfo
)
{
if
(!
UseDoor
)
{
return
false
;
}
//如果门已关闭直接返回
if
(
IOManager
.
IOValue
(
IO_Type
.
Door_Up
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOManager
.
IOValue
(
IO_Type
.
Door_Down
).
Equals
(
IO_VALUE
.
LOW
))
{
return
true
;
}
if
(
moveInfo
!=
null
)
{
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Up
,
IO_VALUE
.
HIGH
));
moveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitIO
(
IO_Type
.
Door_Down
,
IO_VALUE
.
LOW
));
}
return
Start
(
IO_Type
.
Door_Up
,
IO_Type
.
Door_Up
);
}
}
}
source/DeviceLibrary/acVerticalStore/StoreManager.cs
查看文件 @
e178b7d
...
@@ -59,14 +59,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -59,14 +59,14 @@ namespace OnlineStore.DeviceLibrary
isInit
=
true
;
isInit
=
true
;
string
storeType
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Type
);
string
storeType
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Type
);
LogUtil
.
info
(
"
配置的料仓 类型="
+
storeType
+
",开始加载料仓
配置"
);
LogUtil
.
info
(
"
类型="
+
storeType
+
",开始加载
配置"
);
if
(
storeType
==
StoreType
.
RC_AC_SA_
TIN
)
if
(
storeType
==
StoreType
.
RC_AC_SA_
Vertical
)
{
{
string
appPath
=
Application
.
StartupPath
;
string
appPath
=
Application
.
StartupPath
;
string
CID
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
string
CID
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_CID
);
string
linefilePath
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_ConfigPath
);
string
linefilePath
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_ConfigPath
);
StoreConfig
storeConfig
=
CSVConfigReader
.
LoadConfig
(
1
,
CID
,
StoreType
.
RC_AC_SA_
TIN
,
linefilePath
);
StoreConfig
storeConfig
=
CSVConfigReader
.
LoadConfig
(
1
,
CID
,
StoreType
.
RC_AC_SA_
Vertical
,
linefilePath
);
string
positionConfigFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Position_Config
);
string
positionConfigFile
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Store_Position_Config
);
if
(
File
.
Exists
(
positionConfigFile
))
if
(
File
.
Exists
(
positionConfigFile
))
...
@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -77,7 +77,7 @@ namespace OnlineStore.DeviceLibrary
Config
=
(
VerticalStoreConfig
)
storeConfig
;
Config
=
(
VerticalStoreConfig
)
storeConfig
;
Store
=
new
VerticalStoreBean
(
Config
);
Store
=
new
VerticalStoreBean
(
Config
);
Store
.
CID
=
CID
;
Store
.
CID
=
CID
;
LogUtil
.
info
(
"加载
料仓
完成!"
);
LogUtil
.
info
(
"加载
配置
完成!"
);
return
Store
;
return
Store
;
}
}
}
}
...
...
source/DeviceLibrary/acVerticalStore/VerticalStoreBean.cs
查看文件 @
e178b7d
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acVerticalStore/VerticalStoreBean_InOut.cs
查看文件 @
e178b7d
...
@@ -58,11 +58,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -58,11 +58,11 @@ namespace OnlineStore.DeviceLibrary
string
msg
=
""
;
string
msg
=
""
;
if
(
wait
.
IsHomeMove
)
if
(
wait
.
IsHomeMove
)
{
{
wait
.
IsEnd
=
ACHomeMoveIsEnd
(
wait
.
AxisInfo
,
out
msg
);
wait
.
IsEnd
=
AxisBean
.
HomeMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
out
msg
);
}
}
else
else
{
{
wait
.
IsEnd
=
A
CAxisMoveIsEnd
(
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
wait
.
IsEnd
=
A
xisBean
.
ACAxisMoveIsEnd
(
MoveInfo
,
wait
.
AxisInfo
,
wait
.
TargetPosition
,
wait
.
TargetSpeed
,
out
msg
);
}
}
if
(!
msg
.
Equals
(
""
))
if
(!
msg
.
Equals
(
""
))
{
{
...
@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
string
posId
=
param
!=
null
?
param
.
PosId
:
""
;
string
posId
=
param
!=
null
?
param
.
PosId
:
""
;
if
(
runStatus
.
Equals
(
StoreRunStatus
.
Runing
)&&
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
))
if
(
runStatus
.
Equals
(
StoreRunStatus
.
Runing
)&&
MoveInfo
.
MoveType
.
Equals
(
MoveType
.
None
))
{
{
if
(
!
param
.
LoadParam
(
Config
)
)
if
(
param
.
Position
==
null
)
{
{
LogUtil
.
error
(
Name
+
" 启动 "
+
param
.
LogName
+
"失败,找不到库位信息"
);
LogUtil
.
error
(
Name
+
" 启动 "
+
param
.
LogName
+
"失败,找不到库位信息"
);
return
false
;
return
false
;
...
@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -153,7 +153,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else
else
{
{
SI_02_InOutToP1
(
MoveInfo
.
MoveParam
.
MoveP
);
//
SI_02_InOutToP1(MoveInfo.MoveParam.MoveP);
}
}
return
true
;
return
true
;
}
}
...
@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -323,7 +323,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private
void
SI_02_InOutToP1
(
StoreMoveP
moveP
)
private
void
SI_02_InOutToP1
(
)
{
{
//MoveInfo.NextMoveStep(StoreMoveStep.SI_02_InOutToP1);
//MoveInfo.NextMoveStep(StoreMoveStep.SI_02_InOutToP1);
//InStoreLog(" 进出轴到P1,打开舱门");
//InStoreLog(" 进出轴到P1,打开舱门");
...
@@ -406,7 +406,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -406,7 +406,7 @@ namespace OnlineStore.DeviceLibrary
protected
override
void
OutStoreProcess
()
protected
override
void
OutStoreProcess
()
{
{
StoreMoveP
moveP
=
MoveInfo
.
MoveParam
.
MoveP
;
//
StoreMoveP moveP = MoveInfo.MoveParam.MoveP;
if
(
MoveInfo
.
IsInWait
)
if
(
MoveInfo
.
IsInWait
)
{
{
CheckWait
();
CheckWait
();
...
...
source/DeviceLibrary/device/IO/AIManager.cs
deleted
100644 → 0
查看文件 @
4be5928
using
Asa.IOModule
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
namespace
OnlineStore.DeviceLibrary
{
public
abstract
class
AIManager
{
public
bool
NeedShow
=
false
;
public
static
AIManager
Instance
=
null
;
public
static
void
Init
()
{
bool
isAIOBox
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseAIOBOX
).
Equals
(
1
);
if
(
isAIOBox
)
{
Instance
=
new
AIOAIManager
();
}
else
{
Instance
=
new
KNDAIManager
();
}
}
public
static
double
ConvertAI
(
double
aiValue
,
double
defaultValue
)
{
// double xishu = (double)StoreManager.Config.AI_ConvertPosition;
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
return
0
;
}
public
abstract
void
StartConnect
(
params
string
[]
ioIp
);
public
abstract
void
CloseConnect
();
public
abstract
double
GetAIValue
(
string
ioiP
,
int
index
);
}
}
source/DeviceLibrary/device/IO/AIOBOX/AIOAIManager.cs
deleted
100644 → 0
查看文件 @
4be5928
using
Asa.IOModule
;
using
OnlineStore.Common
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Threading.Tasks
;
namespace
OnlineStore.DeviceLibrary
{
public
class
AIOAIManager
:
AIManager
{
private
object
AILock
=
""
;
private
List
<
int
>
AIValList
=
null
;
private
int
AILength
=
4
;
private
Asa
.
IOModule
.
AIOBOX
AIBox
=
null
;
private
System
.
Timers
.
Timer
conTimer
=
null
;
private
List
<
string
>
needConIp
=
new
List
<
string
>();
public
override
void
StartConnect
(
params
string
[]
ipList
)
{
if
(
conTimer
==
null
)
{
conTimer
=
new
System
.
Timers
.
Timer
();
conTimer
.
AutoReset
=
true
;
conTimer
.
Interval
=
60000
;
conTimer
.
Elapsed
+=
ConTimer_Elapsed
;
}
conTimer
.
Enabled
=
false
;
needConIp
=
new
List
<
string
>(
ipList
);
foreach
(
string
ip
in
ipList
)
{
bool
result
=
ConnectionIP
(
ip
);
}
if
(
needConIp
.
Count
>
0
)
{
//启动定时器,1一分钟重连一次
conTimer
.
Start
();
}
}
private
bool
ConnectionIP
(
string
ioIp
)
{
int
autoMS
=
150
;
try
{
AIValList
=
new
List
<
int
>();
AIBox
=
new
Asa
.
IOModule
.
AIOBOX
();
AIBox
.
IP
=
ioIp
;
// bool rtn = AIBox.AutoIP(ioIp);
AIBox
.
SetInput
(
Asa
.
IOModule
.
Box_Type
.
AI
,
AILength
);
AIBox
.
SetOutput
(
Asa
.
IOModule
.
Box_Type
.
DO
,
0
);
AIBox
.
AutoReadInput
(
true
,
autoMS
);
AIBox
.
AI_Changed_Event
+=
Box_AI_Changed_Event
;
LogUtil
.
debug
(
"开始连接AI模块["
+
ioIp
+
"]["
+
autoMS
+
"],尝试重连三次"
);
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
bool
result
=
AIBox
.
Connect
();
if
(
result
)
{
if
(
needConIp
.
Contains
(
ioIp
))
{
needConIp
.
Remove
(
ioIp
);
}
LogUtil
.
info
(
"第【"
+
i
+
"】次连接IO模块["
+
ioIp
+
"]["
+
autoMS
+
"]成功:"
+
AIBox
.
ErrInfo
);
return
true
;
}
else
{
LogUtil
.
error
(
"第【"
+
i
+
"】次连接IO模块["
+
ioIp
+
"]["
+
autoMS
+
"]失败:"
+
AIBox
.
ErrInfo
+
""
);
}
Thread
.
Sleep
(
10
);
}
}
catch
(
Exception
error
)
{
LogUtil
.
error
(
"连接IO模块["
+
ioIp
+
"]["
+
autoMS
+
"]出错:"
+
error
.
ToString
());
}
return
false
;
}
private
void
ConTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
try
{
List
<
string
>
list
=
new
List
<
string
>(
needConIp
);
if
(
list
.
Count
>
0
)
{
foreach
(
string
ip
in
list
)
{
LogUtil
.
info
(
"重连AOI AI 模块 :"
+
ip
);
ConnectionIP
(
ip
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"AOI AI ConTimer_Elapsed 出错: "
+
ex
.
ToString
());
}
}
public
override
void
CloseConnect
()
{
try
{
if
(
AIBox
!=
null
)
{
AIBox
.
Close
();
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"断开AI连接出错:"
+
ex
.
ToString
());
}
}
private
void
Box_AI_Changed_Event
(
AIOBOX
box
,
int
[]
val
)
{
try
{
if
(
val
!=
null
&&
val
.
Length
>=
AILength
)
{
lock
(
AILock
)
{
AIValList
=
new
List
<
int
>();
AIValList
.
AddRange
(
val
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"Box_AI_Changed_Event出错:"
+
ex
.
ToString
());
}
}
public
override
double
GetAIValue
(
string
ioiP
,
int
index
)
{
if
(
AIValList
!=
null
&&
AIValList
.
Count
>
index
)
{
return
AIValList
[
index
];
}
return
-
1
;
}
//public override double ConvertAI(double aiValue, double defaultValue)
//{
// double xishu = (double)ConfigAppSettings.GetNumValue(Setting_Init.AI_ConvertPosition);
// double result = Math.Round((aiValue - defaultValue) / xishu, 2);
// return result;
//}
}
}
source/DeviceLibrary/device/IO/KangNaiDe/AITcpClient.cs
deleted
100644 → 0
查看文件 @
4be5928
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/device/IO/KangNaiDe/KNDAIManager.cs
deleted
100644 → 0
查看文件 @
4be5928
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/device/IO/KangNaiDe/KNDManager.cs
deleted
100644 → 0
查看文件 @
4be5928
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/device/IO/KangNaiDe/MasterTcpClient.cs
deleted
100644 → 0
查看文件 @
4be5928
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/device/led/BaseLedManager.cs
查看文件 @
e178b7d
...
@@ -135,21 +135,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -135,21 +135,8 @@ namespace OnlineStore.DeviceLibrary
public
string
ModuleIP
=
""
;
public
string
ModuleIP
=
""
;
public
static
LEDBaseModule
GetModule
(
string
ip
)
public
static
LEDBaseModule
GetModule
(
string
ip
)
{
{
//if (LEDManager.DeviceLedType.Equals(1))
//{
// LEDColorModule module = new LEDColorModule(ip);
// return module;
//}
//else if (LEDManager.DeviceLedType.Equals(2))
//{
LEDColorArtNet
module
=
new
LEDColorArtNet
(
ip
);
LEDColorArtNet
module
=
new
LEDColorArtNet
(
ip
);
return
module
;
return
module
;
//}
//else
//{
// LEDSingleModule module = new LEDSingleModule(ip);
// return module;
//}
}
}
internal
LEDBaseModule
(
string
ip
)
internal
LEDBaseModule
(
string
ip
)
...
...
source/DeviceLibrary/store/InOutParam.cs
查看文件 @
e178b7d
...
@@ -13,22 +13,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -13,22 +13,12 @@ namespace OnlineStore.DeviceLibrary
{
{
position
=
null
;
position
=
null
;
PosCode
=
code
;
PosCode
=
code
;
PosId
=
posId
;
PosId
=
posId
;
MoveP
=
null
;
this
.
PlateW
=
plateW
;
this
.
PlateW
=
plateW
;
this
.
PlateH
=
plateH
;
this
.
PlateH
=
plateH
;
this
.
paramType
=
type
;
this
.
paramType
=
type
;
}
}
public
InOutParam
(
MoveType
paramType
,
string
posId
,
StoreMoveP
linePosition
,
string
wareNo
=
""
)
{
position
=
null
;
PosCode
=
wareNo
;
PosId
=
posId
;
MoveP
=
linePosition
;
this
.
paramType
=
paramType
;
}
public
string
ToStr
()
public
string
ToStr
()
{
{
if
(
paramType
.
Equals
(
MoveType
.
InStore
))
if
(
paramType
.
Equals
(
MoveType
.
InStore
))
...
@@ -63,10 +53,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -63,10 +53,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 位置坐标名(对应配置表的位置)
/// 位置坐标名(对应配置表的位置)
/// </summary>
/// </summary>
public
string
PosId
=
""
;
public
string
PosId
=
""
;
public
StoreMoveP
MoveP
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 料盘高度
/// 料盘高度
/// </summary>
/// </summary>
...
@@ -76,29 +63,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -76,29 +63,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
int
PlateW
=
0
;
public
int
PlateW
=
0
;
internal
bool
LoadParam
(
VerticalStoreConfig
Config
)
{
//加载位置
if
(
MoveP
==
null
)
{
StoreMoveP
p
=
new
StoreMoveP
();
VerticalPosition
position
=
Position
;
if
(
position
==
null
)
{
LogUtil
.
error
(
"出入库时发现param中取到的Position=null,没有库位不能执行出入库"
);
return
false
;
}
p
.
Middle_P2
=
position
.
MiddleAxis_P2
;
this
.
MoveP
=
p
;
return
true
;
}
return
true
;
}
public
string
LogName
public
string
LogName
{
{
get
get
...
@@ -120,73 +85,6 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,73 +85,6 @@ namespace OnlineStore.DeviceLibrary
}
}
}
}
public
class
StirInfo
{
public
StirInfo
()
{
InStirWork
=
false
;
StartTime
=
DateTime
.
Now
;
StopTime
=
DateTime
.
Now
;
StirParam
=
new
InOutParam
(
MoveType
.
None
,
""
,
""
);
}
/// <summary>
/// 是否在搅拌中
/// </summary>
public
bool
InStirWork
=
false
;
/// <summary>
/// 搅拌区状态:1=物料1已放入,2=物料2已放入,3=搅拌中,4=搅拌完成,等待取出物料,5=物料1已取出,6=物料2已取出,7=全部完成
/// </summary>
public
int
MoveStatus
=
0
;
/// <summary>
/// 开始搅拌信息
/// </summary>
public
DateTime
StartTime
=
DateTime
.
Now
;
/// <summary>
/// 需要停止搅拌的时间
/// </summary>
public
DateTime
StopTime
=
DateTime
.
Now
;
/// <summary>
/// 搅拌参数
/// </summary>
public
InOutParam
StirParam
=
null
;
public
string
toStr
()
{
if
(
MoveStatus
.
Equals
(
0
))
{
return
"暂无搅拌信息"
;
}
string
str
=
"等待物料放入搅拌区"
;
if
(
MoveStatus
.
Equals
(
1
))
{
str
=
"物料1已放入"
;
}
else
if
(
MoveStatus
.
Equals
(
2
))
{
str
=
"物料2已放入"
;
}
else
if
(
MoveStatus
.
Equals
(
3
))
{
str
=
"搅拌中,结束时间:"
+
StopTime
.
ToLongTimeString
();
}
else
if
(
MoveStatus
.
Equals
(
4
))
{
str
=
"搅拌完成,等待物料回库 "
;
}
else
if
(
MoveStatus
.
Equals
(
5
))
{
str
=
"物料1已回库"
;
}
else
if
(
MoveStatus
.
Equals
(
6
))
{
str
=
"物料2已回库"
;
}
return
"["
+
str
+
"]"
+
StirParam
.
ToStr
();
}
}
}
}
source/DeviceLibrary/store/KTK_DeviceBase.cs
deleted
100644 → 0
查看文件 @
4be5928
using
log4net
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
namespace
OnlineStore.DeviceLibrary
{
public
abstract
class
KTK_DeviceBase
{
/// <summary>
/// 料仓单个调试状态(默认不是调试状态)
/// </summary>
public
bool
IsDebug
=
false
;
/// <summary>
///1=设备联机(正常就绪)(入库后,BOX恢复原始状态)(出库后,移载装置恢复原始状态),
///2=急停,3=故障,4=警告,5=调试
/// 6=入库执行中,7=入仓完成,8=入仓失败
/// 9=出库执行,10=出仓完成,11=出库失败
/// </summary>
public
StoreStatus
storeStatus
=
StoreStatus
.
ResetMove
;
/// <summary>
/// 提示消息,一般发给服务器后清空(LineBean表示报警提示消息,BoxBean表示出入库失败的原因记录)
/// </summary>
public
string
WarnMsg
=
""
;
/// <summary>
/// 日志颜色
/// </summary>
protected
static
Color
storeMoveColor
=
Color
.
Blue
;
public
string
Name
=
""
;
public
int
StoreID
=
0
;
/// <summary>
/// 料仓状态
/// </summary>
private
StoreRunStatus
storerunstatus
=
StoreRunStatus
.
Wait
;
/// <summary>
/// 定时器
/// </summary>
protected
System
.
Timers
.
Timer
mainTimer
;
private
bool
isInit
=
false
;
/// <summary>
/// 初始化
/// </summary>
protected
virtual
void
Init
()
{
if
(!
isInit
)
{
MoveInfo
=
new
StoreMoveInfo
(
StoreID
);
mainTimer
=
new
System
.
Timers
.
Timer
();
mainTimer
.
Enabled
=
false
;
mainTimer
.
Interval
=
300
;
mainTimer
.
Elapsed
+=
timersTimer_Elapsed
;
mainTimer
.
AutoReset
=
true
;
isInit
=
true
;
}
}
public
StoreRunStatus
runStatus
{
get
{
return
storerunstatus
;
}
set
{
StoreRunStatus
oldStatus
=
storerunstatus
;
storerunstatus
=
value
;
}
}
/// <summary>
/// 移动信息
/// </summary>
public
StoreMoveInfo
MoveInfo
=
null
;
/// <summary>
/// 定时处理,监听信号,监听IO
/// </summary>
protected
abstract
void
timersTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
);
#
region
出库
/// <summary>
/// 开始出库运动
/// </summary>
public
abstract
bool
StartOutStore
(
InOutParam
param
);
protected
abstract
void
OutStoreProcess
();
#
endregion
#
region
入库
/// <summary>
/// 开始入库移动移动
/// </summary>
public
abstract
bool
StartInStore
(
InOutParam
param
,
bool
isNeedCheckIO
=
false
);
protected
abstract
void
InStoreProcess
();
#
endregion
public
string
GetRunStr
()
{
string
sta
=
"运行中"
;
string
aa
=
""
;
switch
(
runStatus
)
{
case
StoreRunStatus
.
Busy
:
sta
=
"忙碌"
;
break
;
case
StoreRunStatus
.
HomeMoving
:
sta
=
"原点返回"
;
break
;
case
StoreRunStatus
.
Reset
:
sta
=
"重置"
;
break
;
case
StoreRunStatus
.
Runing
:
sta
=
"运行中"
;
break
;
case
StoreRunStatus
.
Wait
:
sta
=
"等待启动"
;
break
;
}
if
(
runStatus
>
StoreRunStatus
.
Wait
)
{
//"0":"急停中", "1":"设备联机", "2":"故障中", "3":"入库执行中", "4":"出库执行中", 5":"料盘入仓位完成", "6":"料盘出仓位完成", 7":"设备调试中",
switch
(
storeStatus
)
{
case
StoreStatus
.
Debugging
:
aa
=
"设备调试中"
;
break
;
case
StoreStatus
.
InStoreEnd
:
aa
=
"料盘入仓位完成"
;
break
;
case
StoreStatus
.
InStoreExecute
:
aa
=
"入库执行中"
;
break
;
case
StoreStatus
.
InTrouble
:
aa
=
"故障中"
;
break
;
case
StoreStatus
.
OutStoreBoxEnd
:
aa
=
"料盘出仓位完成"
;
break
;
case
StoreStatus
.
OutStoreExecute
:
aa
=
"出库执行中"
;
break
;
case
StoreStatus
.
StoreOnline
:
aa
=
"设备联机"
;
break
;
case
StoreStatus
.
SuddenStop
:
aa
=
"急停中"
;
break
;
case
StoreStatus
.
OutMoveExecute
:
aa
=
"出库完成"
;
break
;
case
StoreStatus
.
InStoreFaild
:
aa
=
"入库失败("
+
WarnMsg
+
")"
;
break
;
case
StoreStatus
.
OutStoreFaild
:
aa
=
"出库失败("
+
WarnMsg
+
")"
;
break
;
}
if
(!
aa
.
Equals
(
""
))
{
return
sta
+
"_"
+
aa
;
}
else
{
return
sta
;
}
}
else
{
return
sta
;
}
}
}
}
source/DeviceLibrary/store/KTK_Store.cs
查看文件 @
e178b7d
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/StoreMoveP.cs
deleted
100644 → 0
查看文件 @
4be5928
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
OnlineStore.DeviceLibrary
{
public
class
StoreMoveP
{
/// <summary>
/// 轴1旋转轴 库位点 P2
/// </summary>
public
int
Middle_P2
=
0
;
}
}
source/DeviceLibrary/store/StoreStep.cs
查看文件 @
e178b7d
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/store/model/StoreMoveInfo.cs
查看文件 @
e178b7d
...
@@ -14,9 +14,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -14,9 +14,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
class
StoreMoveInfo
public
class
StoreMoveInfo
{
{
/// <summary>
public
string
Name
=
""
;
/// 超时时间
/// </summary>
public
int
TimeOutSeconds
=
60
;
public
int
TimeOutSeconds
=
60
;
public
StoreMoveInfo
(
int
storeId
)
public
StoreMoveInfo
(
int
storeId
)
{
{
...
...
source/LoadCVSLibrary/position/VerticalPosition.cs
查看文件 @
e178b7d
...
@@ -33,8 +33,34 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -33,8 +33,34 @@ namespace OnlineStore.LoadCSVLibrary
/// 亮灯索引
/// 亮灯索引
/// </summary>
/// </summary>
[
CSVAttribute
(
"亮灯索引"
)]
[
CSVAttribute
(
"亮灯索引"
)]
public
string
Led_Index
{
get
;
set
;
}
public
string
LedIndex
{
get
;
set
;
}
private
List
<
int
>
LedList
=
null
;
public
List
<
int
>
GetLedList
()
{
if
(
LedList
==
null
)
{
LedList
=
new
List
<
int
>();
string
[]
arrays
=
LedIndex
.
Split
(
';'
);
if
(
arrays
.
Length
>
0
)
{
foreach
(
string
str
in
arrays
)
{
try
{
int
led
=
Convert
.
ToInt32
(
str
.
Trim
());
LedList
.
Add
(
led
);
}
catch
(
Exception
ex
)
{
}
}
}
}
return
LedList
;
}
public
static
bool
CheckPosition
(
VerticalPosition
position
,
VerticalStoreConfig
Config
)
public
static
bool
CheckPosition
(
VerticalPosition
position
,
VerticalStoreConfig
Config
)
{
{
...
...
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
查看文件 @
e178b7d
...
@@ -137,7 +137,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -137,7 +137,7 @@ namespace OnlineStore.LoadCSVLibrary
public
static
StoreConfig
LoadConfig
(
int
storeId
,
string
cid
,
string
storeType
,
string
filePath
)
public
static
StoreConfig
LoadConfig
(
int
storeId
,
string
cid
,
string
storeType
,
string
filePath
)
{
{
StoreConfig
config
=
null
;
StoreConfig
config
=
null
;
if
(
storeType
.
Equals
(
StoreType
.
RC_AC_SA_
TIN
))
if
(
storeType
.
Equals
(
StoreType
.
RC_AC_SA_
Vertical
))
{
{
config
=
new
VerticalStoreConfig
(
storeId
,
cid
,
storeType
,
filePath
);
config
=
new
VerticalStoreConfig
(
storeId
,
cid
,
storeType
,
filePath
);
}
}
...
...
source/LoadCVSLibrary/storeConfig/ConfigItemBase.cs
查看文件 @
e178b7d
...
@@ -136,6 +136,11 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -136,6 +136,11 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
[
CSVAttribute
(
"脉冲最大限位"
)]
[
CSVAttribute
(
"脉冲最大限位"
)]
public
int
PositionMax
{
get
;
set
;
}
public
int
PositionMax
{
get
;
set
;
}
public
string
Axis_Brake_DO
=
""
;
public
string
Axis_Run_DO
=
""
;
public
string
GetNameStr
()
public
string
GetNameStr
()
{
{
return
DeviceName
+
"_"
+
GetAxisValue
();
return
DeviceName
+
"_"
+
GetAxisValue
();
...
@@ -148,11 +153,13 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -148,11 +153,13 @@ namespace OnlineStore.LoadCSVLibrary
}
}
return
false
;
return
false
;
}
}
public
bool
PositionIsHasLimit
(){
public
bool
PositionIsHasLimit
()
{
if
(
PositionMin
.
Equals
(
PositionMax
))
if
(
PositionMin
.
Equals
(
PositionMax
))
{
{
return
false
;
return
false
;
}
return
true
;
}
return
true
;
}
}
/// <summary>
/// <summary>
/// 下拉列表显示
/// 下拉列表显示
...
...
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
e178b7d
...
@@ -72,17 +72,10 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -72,17 +72,10 @@ namespace OnlineStore.LoadCSVLibrary
/// </summary>
/// </summary>
public
static
string
Axis_Brake
=
"Axis_Brake"
;
public
static
string
Axis_Brake
=
"Axis_Brake"
;
/// <summary>
/// <summary>
/// DO,升降门刹车ON,
Camera_Led
,6,192.168.200.21,升降门刹车ON,Y07,Y07,,,,,,,,,,
/// DO,升降门刹车ON,
Door_Break
,6,192.168.200.21,升降门刹车ON,Y07,Y07,,,,,,,,,,
/// </summary>
/// </summary>
public
static
string
Camera_Led
=
"Camera_Led"
;
public
static
string
Door_Break
=
"Door_Break"
;
///// <summary>
///// DO,升降门电机上升,Door_Up,7,192.168.200.21,升降门电机上升,Y08,Y08,,,,,,,,,,
///// </summary>
//public static string Door_Up = "Door_Up";
///// <summary>
///// DO,升降门电机下降,Door_Down,8,192.168.200.21,升降门电机下降,Y09,Y09,,,,,,,,,,
///// </summary>
//public static string Door_Down = "Door_Down";
/// <summary>
/// <summary>
/// DO,设备照明ON,Device_Led,9,192.168.200.21,设备照明ON,Y10,Y10,,,,,,,,,,
/// DO,设备照明ON,Device_Led,9,192.168.200.21,设备照明ON,Y10,Y10,,,,,,,,,,
/// </summary>
/// </summary>
...
...
source/LoadCVSLibrary/storeConfig/config/StoreType.cs
查看文件 @
e178b7d
...
@@ -8,6 +8,6 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -8,6 +8,6 @@ namespace OnlineStore.LoadCSVLibrary
{
{
public
class
StoreType
public
class
StoreType
{
{
public
static
string
RC_AC_SA_
TIN
=
"RC_AC_SA_TIN
"
;
public
static
string
RC_AC_SA_
Vertical
=
"RC_AC_SA_Vertical
"
;
}
}
}
}
source/LoadCVSLibrary/storeConfig/config/VerticalStoreConfig.cs
查看文件 @
e178b7d
...
@@ -75,8 +75,13 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -75,8 +75,13 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,,,,,,,,
/// PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,,,,,,,,
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"MiddleAxis_PositionMax"
)]
[
ConfigProAttribute
(
"MiddleAxis_PositionMax"
)]
public
int
MiddleAxis_PositionMax
{
get
;
set
;
}
public
int
MiddleAxis_PositionMax
{
get
;
set
;
}
/// <summary>
/// PRO,Led控制器IP,LED_IP,192.168.200.192,,,,,,,,,,,,,,
/// </summary>
[
ConfigProAttribute
(
"LED_IP"
)]
public
string
LED_IP
{
get
;
set
;
}
protected
override
void
initMustHavePro
()
protected
override
void
initMustHavePro
()
{
{
MustHaveDIList
=
new
List
<
string
>();
MustHaveDIList
=
new
List
<
string
>();
...
@@ -86,7 +91,6 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -86,7 +91,6 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDIList
.
Add
(
IO_Type
.
Door_Up
);
MustHaveDIList
.
Add
(
IO_Type
.
Door_Up
);
MustHaveDIList
.
Add
(
IO_Type
.
Door_Down
);
MustHaveDIList
.
Add
(
IO_Type
.
Door_Down
);
MustHaveDIList
.
Add
(
IO_Type
.
SafetyLightCurtains
);
MustHaveDIList
.
Add
(
IO_Type
.
SafetyLightCurtains
);
MustHaveDIList
.
Add
(
IO_Type
.
SafetyLightCurtains
);
MustHaveDOList
.
Add
(
IO_Type
.
AutoRun_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
AutoRun_HddLed
);
...
@@ -98,7 +102,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -98,7 +102,7 @@ namespace OnlineStore.LoadCSVLibrary
MustHaveDOList
.
Add
(
IO_Type
.
Axis_Brake
);
MustHaveDOList
.
Add
(
IO_Type
.
Axis_Brake
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Up
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Up
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Down
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Down
);
MustHaveDOList
.
Add
(
IO_Type
.
Camera_Led
);
MustHaveDOList
.
Add
(
IO_Type
.
Door_Break
);
}
}
public
static
void
ConfigAxis
(
VerticalStoreConfig
con
)
public
static
void
ConfigAxis
(
VerticalStoreConfig
con
)
{
{
...
@@ -170,58 +174,7 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -170,58 +174,7 @@ namespace OnlineStore.LoadCSVLibrary
}
}
return
16
;
return
16
;
}
}
//private Dictionary<string, string> CodeSizeMap = null;
//private static char codeSpilt = '#';
//public string GetCodeSize(ref string code)
//{
// try
// {
// if (CodeSizeMap == null)
// {
// CodeSizeMap = new Dictionary<string, string>();
// string[] array = CodeSizeConfig.Split(codeSpilt);
// if (array.Length > 0)
// {
// foreach (string str in array)
// {
// string[] codeStr = str.Split('=');
// if (codeStr.Length == 2)
// {
// string key = codeStr[0].Trim();
// string value = codeStr[1].Trim();
// CodeSizeMap.Add(key, value);
// }
// }
// }
// }
// foreach (string key in CodeSizeMap.Keys)
// {
// string[] array = key.Split(';');
// if (array.Length == 1 && code.Trim().StartsWith(key))
// {
// return CodeSizeMap[key];
// }
// else if (array.Length >= 2)
// {
// if (code.Trim().StartsWith(array[0]))
// {
// int leng = array[0].Length;
// code = code.Trim() + key.Substring(leng, key.Length - leng);
// return CodeSizeMap[key];
// }
// }
// }
// }
// catch (Exception ex)
// {
// LOGGER.Error("获取二维码【" + code + "】的固定尺寸出错:" + ex.ToString());
// }
// return "";
//}
}
}
}
}
source/VerticalStoreClinet/App.config
查看文件 @
e178b7d
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
<!--
start
one
store
config
-->
<!--
start
one
store
config
-->
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\linePositions.csv"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\StoreConfig.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA_
TIN
"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA_
Vertical
"
/>
<
add
key
=
"Store_CID"
value
=
"rc1258ac-1"
/>
<
add
key
=
"Store_CID"
value
=
"rc1258ac-1"
/>
<!--
end
one
store
config
-->
<!--
end
one
store
config
-->
...
...
source/VerticalStoreClinet/FrmIOStatus.Designer.cs
查看文件 @
e178b7d
...
@@ -18,6 +18,8 @@
...
@@ -18,6 +18,8 @@
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
btnCloseDoor
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnOpenDoor
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseLed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseLed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnOpenLed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnOpenLed
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseAxisBreak
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnCloseAxisBreak
=
new
System
.
Windows
.
Forms
.
Button
();
...
@@ -38,6 +40,7 @@
...
@@ -38,6 +40,7 @@
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox3
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
chbAutoRead
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
chbAutoRead
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
btnStopDoor
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
...
@@ -54,6 +57,9 @@
...
@@ -54,6 +57,9 @@
this
.
groupBox2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
this
.
groupBox2
.
Anchor
=
((
System
.
Windows
.
Forms
.
AnchorStyles
)((((
System
.
Windows
.
Forms
.
AnchorStyles
.
Top
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Bottom
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnStopDoor
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnCloseDoor
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnOpenDoor
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnCloseLed
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnCloseLed
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnOpenLed
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnOpenLed
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnCloseAxisBreak
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnCloseAxisBreak
);
...
@@ -65,6 +71,30 @@
...
@@ -65,6 +71,30 @@
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"操作测试"
;
this
.
groupBox2
.
Text
=
"操作测试"
;
//
//
// btnCloseDoor
//
this
.
btnCloseDoor
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnCloseDoor
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnCloseDoor
.
Location
=
new
System
.
Drawing
.
Point
(
37
,
176
);
this
.
btnCloseDoor
.
Name
=
"btnCloseDoor"
;
this
.
btnCloseDoor
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnCloseDoor
.
TabIndex
=
258
;
this
.
btnCloseDoor
.
Text
=
"关闭升降门"
;
this
.
btnCloseDoor
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseDoor
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseDoor_Click
);
//
// btnOpenDoor
//
this
.
btnOpenDoor
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnOpenDoor
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnOpenDoor
.
Location
=
new
System
.
Drawing
.
Point
(
37
,
139
);
this
.
btnOpenDoor
.
Name
=
"btnOpenDoor"
;
this
.
btnOpenDoor
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnOpenDoor
.
TabIndex
=
257
;
this
.
btnOpenDoor
.
Text
=
"打开升降门"
;
this
.
btnOpenDoor
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenDoor
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenDoor_Click
);
//
// btnCloseLed
// btnCloseLed
//
//
this
.
btnCloseLed
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnCloseLed
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
...
@@ -73,7 +103,7 @@
...
@@ -73,7 +103,7 @@
this
.
btnCloseLed
.
Name
=
"btnCloseLed"
;
this
.
btnCloseLed
.
Name
=
"btnCloseLed"
;
this
.
btnCloseLed
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnCloseLed
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnCloseLed
.
TabIndex
=
256
;
this
.
btnCloseLed
.
TabIndex
=
256
;
this
.
btnCloseLed
.
Text
=
"关闭照明"
;
this
.
btnCloseLed
.
Text
=
"关闭
设备
照明"
;
this
.
btnCloseLed
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseLed
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseLed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseLed_Click
);
this
.
btnCloseLed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseLed_Click
);
//
//
...
@@ -85,7 +115,7 @@
...
@@ -85,7 +115,7 @@
this
.
btnOpenLed
.
Name
=
"btnOpenLed"
;
this
.
btnOpenLed
.
Name
=
"btnOpenLed"
;
this
.
btnOpenLed
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnOpenLed
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnOpenLed
.
TabIndex
=
255
;
this
.
btnOpenLed
.
TabIndex
=
255
;
this
.
btnOpenLed
.
Text
=
"打开照明"
;
this
.
btnOpenLed
.
Text
=
"打开
设备
照明"
;
this
.
btnOpenLed
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenLed
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenLed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenLed_Click
);
this
.
btnOpenLed
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenLed_Click
);
//
//
...
@@ -97,7 +127,7 @@
...
@@ -97,7 +127,7 @@
this
.
btnCloseAxisBreak
.
Name
=
"btnCloseAxisBreak"
;
this
.
btnCloseAxisBreak
.
Name
=
"btnCloseAxisBreak"
;
this
.
btnCloseAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnCloseAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnCloseAxisBreak
.
TabIndex
=
253
;
this
.
btnCloseAxisBreak
.
TabIndex
=
253
;
this
.
btnCloseAxisBreak
.
Text
=
"关闭刹车"
;
this
.
btnCloseAxisBreak
.
Text
=
"关闭
伺服
刹车"
;
this
.
btnCloseAxisBreak
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseAxisBreak
.
UseVisualStyleBackColor
=
true
;
this
.
btnCloseAxisBreak
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseAxisBreak_Click
);
this
.
btnCloseAxisBreak
.
Click
+=
new
System
.
EventHandler
(
this
.
btnCloseAxisBreak_Click
);
//
//
...
@@ -109,7 +139,7 @@
...
@@ -109,7 +139,7 @@
this
.
btnOpenAxisBreak
.
Name
=
"btnOpenAxisBreak"
;
this
.
btnOpenAxisBreak
.
Name
=
"btnOpenAxisBreak"
;
this
.
btnOpenAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnOpenAxisBreak
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnOpenAxisBreak
.
TabIndex
=
252
;
this
.
btnOpenAxisBreak
.
TabIndex
=
252
;
this
.
btnOpenAxisBreak
.
Text
=
"打开刹车"
;
this
.
btnOpenAxisBreak
.
Text
=
"打开
伺服
刹车"
;
this
.
btnOpenAxisBreak
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenAxisBreak
.
UseVisualStyleBackColor
=
true
;
this
.
btnOpenAxisBreak
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenAxisBreak_Click
);
this
.
btnOpenAxisBreak
.
Click
+=
new
System
.
EventHandler
(
this
.
btnOpenAxisBreak_Click
);
//
//
...
@@ -320,6 +350,18 @@
...
@@ -320,6 +350,18 @@
this
.
chbAutoRead
.
Text
=
"自动读取"
;
this
.
chbAutoRead
.
Text
=
"自动读取"
;
this
.
chbAutoRead
.
UseVisualStyleBackColor
=
true
;
this
.
chbAutoRead
.
UseVisualStyleBackColor
=
true
;
//
//
// btnStopDoor
//
this
.
btnStopDoor
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnStopDoor
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnStopDoor
.
Location
=
new
System
.
Drawing
.
Point
(
37
,
216
);
this
.
btnStopDoor
.
Name
=
"btnStopDoor"
;
this
.
btnStopDoor
.
Size
=
new
System
.
Drawing
.
Size
(
120
,
34
);
this
.
btnStopDoor
.
TabIndex
=
259
;
this
.
btnStopDoor
.
Text
=
"停止升降门"
;
this
.
btnStopDoor
.
UseVisualStyleBackColor
=
true
;
this
.
btnStopDoor
.
Click
+=
new
System
.
EventHandler
(
this
.
btnStopDoor_Click
);
//
// FrmIOStatus
// FrmIOStatus
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
@@ -372,6 +414,9 @@
...
@@ -372,6 +414,9 @@
private
System
.
Windows
.
Forms
.
Button
btnOpenDo
;
private
System
.
Windows
.
Forms
.
Button
btnOpenDo
;
private
System
.
Windows
.
Forms
.
Button
btnWriteSingleDO
;
private
System
.
Windows
.
Forms
.
Button
btnWriteSingleDO
;
private
System
.
Windows
.
Forms
.
Button
btnCloseAll
;
private
System
.
Windows
.
Forms
.
Button
btnCloseAll
;
private
System
.
Windows
.
Forms
.
Button
btnCloseDoor
;
private
System
.
Windows
.
Forms
.
Button
btnOpenDoor
;
private
System
.
Windows
.
Forms
.
Button
btnStopDoor
;
}
}
}
}
source/VerticalStoreClinet/FrmIOStatus.cs
查看文件 @
e178b7d
...
@@ -211,12 +211,12 @@ namespace OnlineStore.TinPasteStore
...
@@ -211,12 +211,12 @@ namespace OnlineStore.TinPasteStore
private
void
btnOpenLed_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenLed_Click
(
object
sender
,
EventArgs
e
)
{
{
IOManager
.
IOMove
(
IO_Type
.
Camera
_Led
,
IO_VALUE
.
HIGH
);
IOManager
.
IOMove
(
IO_Type
.
Device
_Led
,
IO_VALUE
.
HIGH
);
}
}
private
void
btnCloseLed_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseLed_Click
(
object
sender
,
EventArgs
e
)
{
{
IOManager
.
IOMove
(
IO_Type
.
Camera
_Led
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IO_Type
.
Device
_Led
,
IO_VALUE
.
LOW
);
}
}
private
void
WriteDO
(
IO_VALUE
value
)
private
void
WriteDO
(
IO_VALUE
value
)
{
{
...
@@ -244,6 +244,22 @@ namespace OnlineStore.TinPasteStore
...
@@ -244,6 +244,22 @@ namespace OnlineStore.TinPasteStore
WriteDO
(
IO_VALUE
.
LOW
);
WriteDO
(
IO_VALUE
.
LOW
);
}
}
private
void
btnOpenDoor_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"用户点击:打开升降门"
);
DoorBean
.
StartOpen
(
null
);
}
private
void
btnCloseDoor_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"用户点击:关闭升降门"
);
DoorBean
.
StartClose
(
null
);
}
private
void
btnStopDoor_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"用户点击:停止升降门"
);
DoorBean
.
Stop
();
}
}
}
}
}
source/VerticalStoreClinet/FrmStoreBox.Designer.cs
查看文件 @
e178b7d
此文件的差异被折叠,
点击展开。
source/VerticalStoreClinet/FrmStoreBox.cs
查看文件 @
e178b7d
此文件的差异被折叠,
点击展开。
source/VerticalStoreClinet/useControl/AxisMoveControl.cs
查看文件 @
e178b7d
...
@@ -19,6 +19,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -19,6 +19,7 @@ namespace OnlineStore.ACPackingStore
public
partial
class
AxisMoveControl
:
UserControl
public
partial
class
AxisMoveControl
:
UserControl
{
{
private
List
<
ConfigMoveAxis
>
axisList
=
new
List
<
ConfigMoveAxis
>();
private
List
<
ConfigMoveAxis
>
axisList
=
new
List
<
ConfigMoveAxis
>();
private
List
<
AxisBean
>
axisBeans
=
new
List
<
AxisBean
>();
private
VerticalStoreBean
BoxBean
=
null
;
private
VerticalStoreBean
BoxBean
=
null
;
private
string
PortName
=
""
;
private
string
PortName
=
""
;
private
int
SlvAddr
=
0
;
private
int
SlvAddr
=
0
;
...
@@ -31,7 +32,7 @@ namespace OnlineStore.ACPackingStore
...
@@ -31,7 +32,7 @@ namespace OnlineStore.ACPackingStore
{
{
this
.
BoxBean
=
boxBean
;
this
.
BoxBean
=
boxBean
;
axisList
=
new
List
<
ConfigMoveAxis
>(
moveAxis
);
axisList
=
new
List
<
ConfigMoveAxis
>(
moveAxis
);
axisBeans
=
new
List
<
AxisBean
>()
{
BoxBean
.
MiddleAxis
};
if
(
axisList
.
Count
>
0
)
if
(
axisList
.
Count
>
0
)
{
{
comboBox1
.
Items
.
Clear
();
comboBox1
.
Items
.
Clear
();
...
@@ -50,33 +51,34 @@ namespace OnlineStore.ACPackingStore
...
@@ -50,33 +51,34 @@ namespace OnlineStore.ACPackingStore
private
void
btnOpenAxis_Click
(
object
sender
,
EventArgs
e
)
private
void
btnOpenAxis_Click
(
object
sender
,
EventArgs
e
)
{
{
int
bro
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ACBaudRate
);
int
bro
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
ACBaudRate
);
LogUtil
.
info
(
"点击【打开伺服】,端口号【"
+
PortName
+
"】地址【"
+
SlvAddr
+
"】波特率【"
+
bro
+
"】 "
);
LogUtil
.
info
(
"点击【打开伺服】,端口号【"
+
PortName
+
"】地址【"
+
SlvAddr
+
"】波特率【"
+
bro
+
"】 "
);
ACServerManager
.
OpenPort
(
PortName
,
bro
);
//ACServerManager.OpenPort(PortName, bro);
ACServerManager
.
AlarmClear
(
PortName
,
SlvAddr
);
//ACServerManager.AlarmClear(PortName, SlvAddr);
Thread
.
Sleep
(
100
);
//Thread.Sleep(100);
ACServerManager
.
ServoOn
(
PortName
,
SlvAddr
);
//ACServerManager.ServoOn(PortName, SlvAddr);
int
index
=
comboBox1
.
SelectedIndex
;
string
msg
=
""
;
bool
result
=
axisBeans
[
index
].
Open
(
false
,
out
msg
);
if
(!
result
)
{
MessageBox
.
Show
(
msg
);
}
}
}
private
void
btnCloseAxis_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseAxis_Click
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
info
(
"点击【关闭伺服】,端口号【"
+
PortName
+
"】地址【"
+
SlvAddr
+
"】 "
);
LogUtil
.
info
(
"点击【关闭伺服】,端口号【"
+
PortName
+
"】地址【"
+
SlvAddr
+
"】 "
);
ACServerManager
.
ServoOff
(
PortName
,
SlvAddr
);
// ACServerManager.ServoOff(PortName, SlvAddr);
int
index
=
comboBox1
.
SelectedIndex
;
axisBeans
[
index
].
ServoOff
();
}
}
private
bool
AxisCanMove
()
private
bool
AxisCanMove
()
{
{
//if (BoxBean.Config.Middle_Axis.IsSameAxis(PortName, SlvAddr) || BoxBean.Config.UpDown_Axis.IsSameAxis(PortName, SlvAddr))
if
(
IOManager
.
IOValue
(
IO_Type
.
SafetyLightCurtains
).
Equals
(
IO_VALUE
.
LOW
))
//{
{
// int InOutDefaultPosition = ConfigAppSettings.GetIntValue(Setting_Init.InOutDefaultPosition);
return
false
;
// int currValue = ACServerManager.GetActualtPosition(BoxBean.Config.InOut_Axis.DeviceName, BoxBean.Config.InOut_Axis.GetAxisValue());
}
// //旋转轴和升降轴运动时,叉子必须在待机位
// if (currValue > InOutDefaultPosition)
// {
// MessageBox.Show("叉子不在待机位,请先将叉子退回待机位(" + InOutDefaultPosition + ")", "警告(叉子在待机位时,才能移动升降轴和旋转轴) ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
// return false;
// }
//}
return
true
;
return
true
;
}
}
private
void
btnAxisAMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisAMove_Click
(
object
sender
,
EventArgs
e
)
...
...
source/VerticalStoreClinet/记录.txt
查看文件 @
e178b7d
在RC1258-ACSingleStore基础上,
新建锡膏料仓 TinPasteStore
21 锡膏储存/回温/搅拌柜 SO435 1261 TinPasteStore
搅拌轴旋转时 定位气缸必须在上升端。
复位完成后,回温区旋转轴和冷藏区旋转轴需要匀速旋转
\ No newline at end of file
\ No newline at end of file
新建VerticalStore
RC1275-SO479-垂直循环料柜
垂直料柜,出库:从服务器查找出库,发posId给客户端。
门打开后,操作人员拿走料盒,点关门按钮关门
入库:服务器点入库按钮->选择物料种类(大料盒或者小料盒)->输入物料名称->发送posId给客户端开始入库
门打开后,操作人员放入料盒,点关门按钮关门
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论