Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 8fe7045d
由
LN
编写于
2021-04-07 14:28:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
新料仓ID号为25,26
1 个父辈
05fd6ac8
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
221 行增加
和
130 行删除
source/AssemblyLineClient/AssemblyLineClient.csproj
source/AssemblyLineClient/FrmIOMsg.cs
source/AssemblyLineClient/FrmLineStore.Designer.cs
source/AssemblyLineClient/FrmLineStore.cs
source/AssemblyLineClient/image/line.png
source/DeviceLibrary/LineConfig/Config_Line.csv
source/DeviceLibrary/assemblyLine/EquipBase.cs
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
source/DeviceLibrary/assemblyLine/LineBean_Shunt2.cs
source/DeviceLibrary/assemblyLine/MoveEquip.cs
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
source/DeviceLibrary/assemblymanager/SServerManager.cs
source/DeviceLibrary/assemblymanager/TrayManager.cs
source/DeviceLibrary/server/LineServer.cs
source/AssemblyLineClient/AssemblyLineClient.csproj
查看文件 @
8fe7045
...
...
@@ -273,6 +273,9 @@
</Content>
<Content Include="box.ico" />
<Content Include="DfIcon.ico" />
<EmbeddedResource Include="image\line.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</EmbeddedResource>
<Content Include="记录.txt" />
</ItemGroup>
<ItemGroup>
...
...
@@ -287,9 +290,7 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Folder Include="image\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
...
...
source/AssemblyLineClient/FrmIOMsg.cs
查看文件 @
8fe7045
...
...
@@ -60,7 +60,11 @@ namespace OnlineStore.AssemblyLine
lblBox
.
Text
=
"料仓连接信息:\r\n"
;
msg
=
""
;
List
<
int
>
list
=
new
List
<
int
>(
LineManager
.
Line
.
MoveEquipMap
.
Keys
);
List
<
int
>
list
=
new
List
<
int
>();
foreach
(
MoveEquip
move
in
LineManager
.
Line
.
MoveEquipMap
.
Values
)
{
list
.
Add
(
move
.
StoreID
);
}
foreach
(
int
storeId
in
list
)
{
...
...
source/AssemblyLineClient/FrmLineStore.Designer.cs
查看文件 @
8fe7045
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
8fe7045
...
...
@@ -172,7 +172,7 @@ namespace OnlineStore.AssemblyLine
lvi
.
SubItems
.
Add
(
move
.
alarmType
.
ToString
());
// lvi.SubItems.Add(move.lineStatus.ToString());
lvi
.
SubItems
.
Add
(
move
.
GetRunStr
());
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
move
.
Devic
eID
);
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
move
.
Stor
eID
);
if
(
box
!=
null
)
{
string
online
=
"✘"
;
...
...
@@ -227,16 +227,16 @@ namespace OnlineStore.AssemblyLine
lvi
.
SubItems
.
Add
(
equip
.
GetRunStr
());
this
.
listView1
.
Items
.
Add
(
lvi
);
}
cmbBoxIndex
.
Items
.
Clear
();
foreach
(
int
key
in
lineBean
.
MoveEquipMap
.
Keys
)
{
cmbBoxIndex
.
Items
.
Add
(
"BOX-"
+
key
);
//
cmbBoxIndex.Items.Clear();
//
foreach (int key in lineBean.MoveEquipMap.Keys)
//
{
//
cmbBoxIndex.Items.Add("BOX-" + key);
}
if
(
cmbBoxIndex
.
Items
.
Count
>
0
)
{
cmbBoxIndex
.
SelectedIndex
=
0
;
}
//
}
//
if (cmbBoxIndex.Items.Count > 0)
//
{
//
cmbBoxIndex.SelectedIndex = 0;
//
}
}
private
void
AddHealder
(
string
name
,
int
widht
)
{
...
...
@@ -591,7 +591,7 @@ namespace OnlineStore.AssemblyLine
SetItemText
(
i
,
item_debug_index
,
move
.
Config
.
IsDebug
.
Equals
(
1
)
?
"✘"
:
"✔"
);
SetItemText
(
i
,
item_alarm_index
,
move
.
alarmType
.
ToString
());
SetItemText
(
i
,
item_runStr_index
,
move
.
GetRunStr
());
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
move
.
Devic
eID
);
BoxInfo
box
=
LineServer
.
GetBoxInfo
(
move
.
Stor
eID
);
if
(
box
!=
null
)
{
SetItemText
(
i
,
item_cid_index
,
box
.
CId
.
ToString
());
...
...
@@ -816,71 +816,90 @@ namespace OnlineStore.AssemblyLine
ExitApp
();
}
private
void
btnInStoreTset_Click
(
object
sender
,
EventArgs
e
)
{
if
(
LineServer
.
IsStart
)
{
int
index
=
cmbBoxIndex
.
SelectedIndex
+
1
;
string
posId
=
txtPosId
.
Text
.
Trim
();
if
(
String
.
IsNullOrEmpty
(
posId
))
{
MessageBox
.
Show
(
"请输入正确的库位号"
);
txtPosId
.
Focus
();
return
;
}
LineServer
.
StartInStore
(
index
,
new
InOutParam
(
0
,
""
,
posId
,
0
,
0
));
}
}
//
private void btnInStoreTset_Click(object sender, EventArgs e)
//
{
//
if (LineServer.IsStart)
//
{
//
int index = cmbBoxIndex.SelectedIndex + 1;
//
string posId = txtPosId.Text.Trim();
//
if (String.IsNullOrEmpty(posId))
//
{
//
MessageBox.Show("请输入正确的库位号");
//
txtPosId.Focus();
//
return;
//
}
//
LineServer.StartInStore(index, new InOutParam(0, "", posId, 0, 0));
//
}
//
}
private
void
listView1_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
btnUpdateStatus
.
Visible
=
false
;
if
(
listView1
.
SelectedItems
!=
null
&&
listView1
.
SelectedItems
.
Count
>
0
)
{
int
index
=
listView1
.
SelectedItems
[
0
].
Index
;
string
name
=
listView1
.
Items
[
index
].
SubItems
[
0
].
Text
;
name
=
"BOX-"
+
(
index
+
1
);
BoxInfo
boxInfo
=
LineServer
.
GetBoxInfo
(
index
+
1
);
if
(
boxInfo
!=
null
&&
boxInfo
.
SRunStatus
>=
1
)
{
if
(
boxInfo
.
SStatus
.
Equals
((
int
)
LineStatus
.
Debugging
))
{
btnUpdateStatus
.
Text
=
"更改["
+
name
+
"]为工作状态"
;
}
else
{
btnUpdateStatus
.
Text
=
"更改["
+
name
+
"]为调试状态"
;
}
btnUpdateStatus
.
Visible
=
true
;
}
}
//btnUpdateStatus.Visible = false;
//if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
//{
// int index = listView1.SelectedItems[0].Index;
// string name = listView1.Items[index].SubItems[0].Text;
// name = "BOX-" + (index + 1);
// MoveEquip moveEquip = LineManager.Line.GetMoveByDId(index + 1);
// if (moveEquip != null)
// {
// int storeID = moveEquip.StoreID;
// BoxInfo boxInfo = LineServer.GetBoxInfo(storeID);
// if (boxInfo != null && boxInfo.SRunStatus >= 1)
// {
// if (boxInfo.SStatus.Equals((int)LineStatus.Debugging))
// {
// btnUpdateStatus.Text = "更改[" + name + "]为工作状态";
// }
// else
// {
// btnUpdateStatus.Text = "更改[" + name + "]为调试状态";
// }
// btnUpdateStatus.Visible = true;
// }
// }
// else
// {
// btnUpdateStatus.Visible = true;
// }
//}
}
private
void
btnUpdateStatus_Click
(
object
sender
,
EventArgs
e
)
{
if
(
listView1
.
SelectedItems
!=
null
&&
listView1
.
SelectedItems
.
Count
>
0
)
{
int
index
=
listView1
.
SelectedItems
[
0
].
Index
;
//
private void btnUpdateStatus_Click(object sender, EventArgs e)
//
{
//
if (listView1.SelectedItems != null && listView1.SelectedItems.Count > 0)
//
{
//
int index = listView1.SelectedItems[0].Index;
string
name
=
"BOX-"
+
(
index
+
1
);
BoxInfo
boxInfo
=
LineServer
.
GetBoxInfo
(
index
+
1
);
if
(
boxInfo
!=
null
&&
boxInfo
.
SRunStatus
>=
1
)
{
if
(
boxInfo
.
SStatus
.
Equals
((
int
)
LineStatus
.
Debugging
))
{
LogUtil
.
info
(
"点击【 更改["
+
name
+
"]为工作状态 】"
);
LineServer
.
UpdateBoxDebug
(
boxInfo
.
ID
,
0
);
}
else
{
LogUtil
.
info
(
"点击【 更改["
+
name
+
"]为调试状态 】"
);
LineServer
.
UpdateBoxDebug
(
boxInfo
.
ID
,
1
);
}
btnUpdateStatus
.
Visible
=
false
;
}
}
}
// string name = "BOX-" + (index + 1);
// //BoxInfo boxInfo = LineServer.GetBoxInfo(index + 1);
// MoveEquip moveEquip = LineManager.Line.GetMoveByDId(index + 1);
// if (moveEquip != null)
// {
// int storeID = moveEquip.StoreID;
// BoxInfo boxInfo = LineServer.GetBoxInfo(storeID);
// if (boxInfo != null && boxInfo.SRunStatus >= 1)
// {
// if (boxInfo.SStatus.Equals((int)LineStatus.Debugging))
// {
// LogUtil.info("点击【 更改[" + name + "]为工作状态 】");
// LineServer.UpdateBoxDebug(boxInfo.ID, 0);
// }
// else
// {
// LogUtil.info("点击【 更改[" + name + "]为调试状态 】");
// LineServer.UpdateBoxDebug(boxInfo.ID, 1);
// }
// btnUpdateStatus.Visible = false;
// }
// }
// else
// {
// btnUpdateStatus.Visible = false;
// }
// }
//}
...
...
source/AssemblyLineClient/image/line.png
查看文件 @
8fe7045
104.3 KB
|
宽:
|
高:
98.7 KB
|
宽:
|
高:
两方对比
交换覆盖
透明覆盖
source/DeviceLibrary/LineConfig/Config_Line.csv
查看文件 @
8fe7045
...
...
@@ -71,8 +71,8 @@ PRO,0,入料流水线4-上料模块-RFID-IP,PRO_RFIP_104-1,192.168.210.118,,,,,
PRO,0,当多久没操作时流水线休眠(秒),Sleep_MSeconds,600,,,,,
PRO,0,气压检测信号关闭需要持续的时间,AirCheckSeconds,600,,,,,
PRO,0,IO信号超时时间(秒),IOSingle_TimerOut,15,,,,,
PRO,0,IO模块对应的DI数量,IO_DILength,192.168.111.33#8;192.168.111.35#8;192.168.111.37#16;192.168.111.39#8;192.168.111.41#16;,,,,,
PRO,0,模块对应的DO数量,IO_DOLength,192.168.111.33#8;192.168.111.35#8;192.168.111.37#16;192.168.111.39#8;192.168.111.41#16;,,,,,
PRO,0,IO模块对应的DI数量,IO_DILength,192.168.111.33#8;192.168.111.35#8;192.168.111.37#16;192.168.111.39#8;192.168.111.41#16;
192.168.111.51#8;
,,,,,
PRO,0,模块对应的DO数量,IO_DOLength,192.168.111.33#8;192.168.111.35#8;192.168.111.37#16;192.168.111.39#8;192.168.111.41#16;
192.168.111.51#8;
,,,,,
,,,,,,,,,
,,,,,,,,,
DI,0,急停,SuddenStop_BTN,0,PRO_AOI_IP_1,0,急停,X001,X001
...
...
source/DeviceLibrary/assemblyLine/EquipBase.cs
查看文件 @
8fe7045
...
...
@@ -511,8 +511,8 @@ namespace OnlineStore.DeviceLibrary
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W008_InStoreCheckOK
))
{
string
posId
=
moveInfo
.
MoveParam
.
PosId
;
int
i
d
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
i
d
,
posId
);
int
storeI
d
=
moveInfo
.
MoveParam
.
GetStoreId
();
wait
.
IsEnd
=
LineServer
.
RightInPosId
(
storeI
d
,
posId
);
}
else
if
(
wait
.
WaitType
.
Equals
(
WaitEnum
.
W009_BoxCanInstore
))
{
...
...
source/DeviceLibrary/assemblyLine/FeedingEquip_InStore.cs
查看文件 @
8fe7045
...
...
@@ -421,7 +421,7 @@ namespace OnlineStore.DeviceLibrary
{
if
(
MoveInfo
.
MoveStep
<
LineMoveStep
.
FI_25_WaitTray
)
{
if
(
SecondMoveInfo
.
IsTimeOut
(
30
))
if
(
SecondMoveInfo
.
IsTimeOut
(
15
))
{
WarnMsg
=
SecondMoveInfo
.
Name
+
"["
+
SecondMoveInfo
.
MoveStep
+
"] 等待入库托盘超时 ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
+
",暂时放托盘离开"
);
...
...
@@ -1176,7 +1176,7 @@ namespace OnlineStore.DeviceLibrary
getPosIdMsg
=
""
;
ClearTimeoutAlarm
(
"获取库位号超时"
);
}
else
if
(
MoveInfo
.
IsTimeOut
(
30
))
else
if
(
MoveInfo
.
IsTimeOut
(
15
))
{
WarnMsg
=
MoveInfo
.
Name
+
"["
+
MoveInfo
.
MoveStep
+
"] 获取库位号超时 "
+
getPosIdMsg
+
" ["
+
Math
.
Round
(
MoveInfo
.
StepSpan
().
TotalSeconds
,
1
)
+
"]秒"
;
LogUtil
.
error
(
WarnMsg
,
DeviceID
*
1000
+
30
);
...
...
@@ -1761,12 +1761,12 @@ namespace OnlineStore.DeviceLibrary
{
if
(
DeviceID
.
Equals
(
102
))
{
MoveEquip
moveEquip7
=
LineManager
.
Line
.
MoveEquipMap
[
7
]
;
MoveEquip
moveEquip7
=
LineManager
.
Line
.
GetMoveByDId
(
7
)
;
if
(
moveEquip7
.
IsWaitEmptyTray
())
{
return
true
;
}
MoveEquip
moveEquip8
=
LineManager
.
Line
.
MoveEquipMap
[
8
]
;
MoveEquip
moveEquip8
=
LineManager
.
Line
.
GetMoveByDId
(
8
)
;
if
(
moveEquip8
.
IsWaitEmptyTray
())
{
return
true
;
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
8fe7045
...
...
@@ -1129,5 +1129,23 @@ namespace OnlineStore.DeviceLibrary
conIsPro
=
false
;
}
}
public
MoveEquip
GetMoveByDId
(
int
deviceId
)
{
if
(
MoveEquipMap
.
ContainsKey
(
deviceId
))
{
return
MoveEquipMap
[
deviceId
];
}
foreach
(
MoveEquip
m
in
MoveEquipMap
.
Values
)
{
if
(
m
.
StoreID
.
Equals
(
deviceId
))
{
return
m
;
}
}
return
null
;
}
}
}
\ No newline at end of file
source/DeviceLibrary/assemblyLine/LineBean_Partial.cs
查看文件 @
8fe7045
...
...
@@ -1095,7 +1095,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
public
void
boxBean_OutStoreEnd
(
int
storeId
,
InOutParam
param
)
{
MoveEquip
moveEquip
=
MoveEquipMap
[
storeId
]
;
MoveEquip
moveEquip
=
GetMoveByDId
(
storeId
)
;
string
posId
=
param
!=
null
?
param
.
PosId
:
""
;
if
(
moveEquip
.
IsDebug
)
{
...
...
@@ -1135,11 +1135,15 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
if
(!
MoveEquipMap
.
ContainsKey
(
id
))
//if (!MoveEquipMap.ContainsKey(id))
//{
// return false;
//}
MoveEquip
move
=
GetMoveByDId
(
id
);
if
(
move
==
null
)
{
return
false
;
}
MoveEquip
move
=
MoveEquipMap
[
id
];
if
(!
move
.
NoAlarm
()
||
move
.
waitInStoreList
.
Count
>
0
||
move
.
IsDebug
||
move
.
waitOutStoreList
.
Count
>
0
)
{
return
false
;
...
...
@@ -1185,11 +1189,15 @@ namespace OnlineStore.DeviceLibrary
{
return
false
;
}
if
(!
MoveEquipMap
.
ContainsKey
(
id
))
//if (!MoveEquipMap.ContainsKey(id))
//{
// return false;
//}
MoveEquip
move
=
GetMoveByDId
(
id
);
if
(
move
==
null
)
{
return
false
;
}
MoveEquip
move
=
MoveEquipMap
[
id
];
if
(
move
.
IsDebug
)
//if (!move.NoErrorAlarm() || move.IsDebug || move.waitOutStoreList.Count > 0)
{
...
...
source/DeviceLibrary/assemblyLine/LineBean_Shunt.cs
查看文件 @
8fe7045
...
...
@@ -388,7 +388,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveEquip
moveEquip10
=
LineManager
.
Line
.
MoveEquipMap
[
10
]
;
MoveEquip
moveEquip10
=
LineManager
.
Line
.
GetMoveByDId
(
10
)
;
if
(
moveEquip10
.
IsWaitEmptyTray
())
{
return
false
;
...
...
source/DeviceLibrary/assemblyLine/LineBean_Shunt2.cs
查看文件 @
8fe7045
...
...
@@ -239,7 +239,7 @@ namespace OnlineStore.DeviceLibrary
//Shunt2_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Shunt2_TopCylinder_Down2, IO_VALUE.LOW));
}
LineManager
.
Line
.
MoveEquipMap
[
5
]
.
EndProcessTray
();
LineManager
.
Line
.
GetMoveByDId
(
5
)
.
EndProcessTray
();
}
else
{
...
...
source/DeviceLibrary/assemblyLine/MoveEquip.cs
查看文件 @
8fe7045
...
...
@@ -18,9 +18,20 @@ namespace OnlineStore.DeviceLibrary
public
MoveEquip_Config
Config
;
private
bool
ClampNeedCheck
=
false
;
public
int
StoreID
=
0
;
public
MoveEquip
(
string
cid
,
MoveEquip_Config
config
)
{
this
.
DeviceID
=
config
.
Id
;
StoreID
=
DeviceID
;
if
(
DeviceID
.
Equals
(
19
))
{
StoreID
=
25
;
}
else
if
(
DeviceID
.
Equals
(
20
))
{
StoreID
=
26
;
}
this
.
Config
=
config
;
baseConfig
=
config
;
IsDebug
=
config
.
IsDebug
.
Equals
(
1
);
...
...
source/DeviceLibrary/assemblyLine/MoveEquip_Partial.cs
查看文件 @
8fe7045
...
...
@@ -448,12 +448,12 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_15_SendPosToStore
);
InLog
(
"入库 "
+
MoveInfo
.
SLog
+
",通知BOX开始入库,等待3000"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
LineServer
.
StartInStore
(
Devic
eID
,
MoveInfo
.
MoveParam
);
LineServer
.
StartInStore
(
Stor
eID
,
MoveInfo
.
MoveParam
);
sendCount
=
1
;
}
else
if
(
MoveInfo
.
MoveStep
.
Equals
(
LineMoveStep
.
MI_15_SendPosToStore
))
{
if
(!
LineServer
.
IsInStorePro
(
Devic
eID
,
MoveInfo
.
MoveParam
.
PosId
))
if
(!
LineServer
.
IsInStorePro
(
Stor
eID
,
MoveInfo
.
MoveParam
.
PosId
))
{
//InLog("入库 " + MoveInfo.SLog + " , 送料流程完成,料仓还未开始入库,再次发送starIn命令");
//LineServer.StartInStore(DeviceID, MoveInfo.MoveParam);
...
...
@@ -461,7 +461,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo
.
NextMoveStep
(
LineMoveStep
.
MI_15_SendPosToStore
);
InLog
(
"入库 "
+
MoveInfo
.
SLog
+
",再次通知BOX开始入库,等待3000"
);
MoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
3000
));
LineServer
.
StartInStore
(
Devic
eID
,
MoveInfo
.
MoveParam
);
LineServer
.
StartInStore
(
Stor
eID
,
MoveInfo
.
MoveParam
);
sendCount
++;
if
(
sendCount
>=
3
)
...
...
@@ -528,7 +528,7 @@ namespace OnlineStore.DeviceLibrary
return
false
;
}
//判断是否验证成功,如果验证失败,不入库
else
if
(
LineServer
.
RightInPosId
(
Devic
eID
,
cc
.
PosId
))
else
if
(
LineServer
.
RightInPosId
(
Stor
eID
,
cc
.
PosId
))
{
SecondMoveInfo
.
MoveParam
=
new
InOutParam
(
cc
.
TrayNumber
,
cc
.
WareCode
,
cc
.
PosId
,
cc
.
PlateH
,
cc
.
PlateW
,
cc
.
InStoreNg
);
return
true
;
...
...
@@ -647,7 +647,7 @@ namespace OnlineStore.DeviceLibrary
}
if
(
reIndex
>=
0
)
{
if
(!
LineServer
.
BoxCanInStore
(
Devic
eID
))
if
(!
LineServer
.
BoxCanInStore
(
Stor
eID
))
{
LogInfo
(
"*******托盘"
+
currTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】,BoxCanInStore验证失败,先放托盘通过"
);
return
false
;
...
...
@@ -655,7 +655,7 @@ namespace OnlineStore.DeviceLibrary
else
{
//判断是否验证成功,如果验证失败,不入库
if
(
LineServer
.
RightInPosId
(
Devic
eID
,
currCode
.
PosId
))
if
(
LineServer
.
RightInPosId
(
Stor
eID
,
currCode
.
PosId
))
{
//waitInStoreList.RemoveAt(reIndex);
LogInfo
(
"*******托盘"
+
currTrayNum
+
"需要入库【"
+
currCode
.
ToStr
()
+
"】 ,开始入库移栽,清理托盘时再删除入库任务"
);
...
...
@@ -908,7 +908,7 @@ namespace OnlineStore.DeviceLibrary
}
else
if
(
SecondMoveInfo
.
MoveParam
!=
null
)
{
if
(!
LineServer
.
RightInPosId
(
Devic
eID
,
SecondMoveInfo
.
MoveParam
.
PosId
))
if
(!
LineServer
.
RightInPosId
(
Stor
eID
,
SecondMoveInfo
.
MoveParam
.
PosId
))
{
LogUtil
.
error
(
Name
+
" "
+
SecondMoveInfo
.
SLog
+
"["
+
SecondMoveInfo
.
MoveParam
.
PosId
+
"]料仓未验证成功,等待9秒"
);
SecondMoveInfo
.
WaitList
.
Add
(
WaitResultInfo
.
WaitTime
(
9000
));
...
...
source/DeviceLibrary/assemblymanager/SServerManager.cs
查看文件 @
8fe7045
...
...
@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
int
storeId
=
InOutParam
.
GetPosStoreId
(
posId
);
string
wareNum
=
serverResult
.
barcode
;
//根据库位号查找移栽
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
]
;
MoveEquip
moveEquip
=
LineManager
.
Line
.
GetMoveByDId
(
storeId
)
;
// 判断PosID是否已经在入库或者在排队列表中,如果已经存在,加入列表失败
InOutParam
param
=
new
InOutParam
(
trayNum
,
wareNum
,
posId
,
plateH
,
plateW
);
param
.
rfid
=
rfid
;
...
...
@@ -128,7 +128,7 @@ namespace OnlineStore.DeviceLibrary
TrayManager
.
UpdateTrayInfo
(
trayNum
,
true
,
ReelType
.
InStore
,
new
InOutParam
(
trayNum
,
wareNum
,
posId
,
plateH
,
plateW
,
false
));
//TODO:判断BOX是否处于可以入库状态,如果调试或急停中,需要返回给服务器;
if
(
LineServer
.
BoxCanInStore
(
moveEquip
.
DeviceID
))
if
(
LineServer
.
BoxCanInStore
(
storeId
))
{
LineServer
.
CheckInStorePos
(
storeId
,
param
);
}
...
...
@@ -544,9 +544,9 @@ namespace OnlineStore.DeviceLibrary
result
.
Param
=
new
InOutParam
(
0
,
serverResult
.
barcode
,
posId
,
height
,
width
);
result
.
Param
.
rfid
=
rfid
;
int
storeId
=
result
.
Param
.
GetStoreId
();
if
(
LineManager
.
Line
.
MoveEquipMap
.
ContainsKey
(
storeId
))
MoveEquip
moveEquip
=
LineManager
.
Line
.
GetMoveByDId
(
storeId
);
if
(
moveEquip
!=
null
)
{
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
if
(
LineManager
.
Line
.
IsReviceInPosId
(
moveEquip
,
posId
))
{
result
.
Param
.
InStoreNg
=
true
;
...
...
@@ -578,8 +578,8 @@ namespace OnlineStore.DeviceLibrary
return
;
}
int
storeId
=
param
.
GetStoreId
();
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
]
;
if
(
LineServer
.
BoxCanInStore
(
moveEquip
.
DeviceID
))
MoveEquip
moveEquip
=
LineManager
.
Line
.
GetMoveByDId
(
storeId
)
;
if
(
LineServer
.
BoxCanInStore
(
storeId
))
{
LineServer
.
CheckInStorePos
(
storeId
,
param
);
}
...
...
source/DeviceLibrary/assemblymanager/TrayManager.cs
查看文件 @
8fe7045
...
...
@@ -189,9 +189,10 @@ namespace OnlineStore.DeviceLibrary
if
(
tray
.
InOrOutStore
.
Equals
(
1
)
&&
tray
.
InoutPar
.
InStoreNg
.
Equals
(
false
)
&&
(!
tray
.
InoutPar
.
PosId
.
Equals
(
""
)))
{
int
storeId
=
tray
.
InoutPar
.
GetStoreId
();
if
(
storeId
>
0
&&
LineManager
.
Line
.
MoveEquipMap
.
ContainsKey
(
storeId
))
MoveEquip
moveEquip
=
LineManager
.
Line
.
GetMoveByDId
(
storeId
);
if
(
storeId
>
0
&&
(
moveEquip
!=
null
))
{
MoveEquip
moveEquip
=
LineManager
.
Line
.
MoveEquipMap
[
storeId
];
//
MoveEquip moveEquip = LineManager.Line.MoveEquipMap[storeId];
moveEquip
.
RemoveInStore
(
tray
.
InoutPar
,
msg
);
}
}
...
...
source/DeviceLibrary/server/LineServer.cs
查看文件 @
8fe7045
...
...
@@ -21,11 +21,27 @@ namespace OnlineStore.DeviceLibrary
public
static
Dictionary
<
int
,
TcpClientBean
>
ClientMap
=
new
Dictionary
<
int
,
TcpClientBean
>();
public
static
BoxInfo
GetBoxInfo
(
int
id
)
public
static
BoxInfo
GetBoxInfo
(
int
storeID
)
{
if
(
BoxMap
.
ContainsKey
(
id
))
if
(
BoxMap
.
ContainsKey
(
storeID
))
{
return
BoxMap
[
id
];
return
BoxMap
[
storeID
];
}
else
{
int
newId
=
storeID
;
if
(
storeID
.
Equals
(
19
))
{
newId
=
25
;
}
else
if
(
storeID
.
Equals
(
20
))
{
newId
=
26
;
}
if
(
BoxMap
.
ContainsKey
(
newId
))
{
return
BoxMap
[
newId
];
}
}
return
null
;
}
...
...
@@ -275,15 +291,16 @@ namespace OnlineStore.DeviceLibrary
}
public
static
bool
UpdateBoxDebug
(
int
id
,
int
isDebug
)
{
if
(
ClientMap
.
ContainsKey
(
id
))
TcpClientBean
client
=
GetClientBean
(
id
);
if
(
client
!=
null
)
{
Dictionary
<
string
,
object
>
paramList
=
new
Dictionary
<
string
,
object
>();
paramList
.
Add
(
S_Cmd
,
cmd_updateDebug
);
int
canOutStore
=
LineManager
.
Line
.
CanOutStore
(
id
)
?
1
:
0
;
paramList
.
Add
(
S_CanOutStore
,
canOutStore
);
paramList
.
Add
(
S_IsDebug
,
isDebug
);
string
msg
=
ToParamStr
(
paramList
);
TcpClientBean
client
=
ClientMap
[
id
];
string
msg
=
ToParamStr
(
paramList
);
//
TcpClientBean client = ClientMap[id];
bool
result
=
SendStrToClient
(
client
,
msg
);
if
(!
result
)
{
...
...
@@ -294,7 +311,8 @@ namespace OnlineStore.DeviceLibrary
}
public
static
bool
StartInStore
(
int
id
,
InOutParam
param
)
{
if
(
ClientMap
.
ContainsKey
(
id
))
TcpClientBean
client
=
GetClientBean
(
id
);
if
(
client
!=
null
)
{
Dictionary
<
string
,
object
>
paramList
=
new
Dictionary
<
string
,
object
>();
paramList
.
Add
(
S_Cmd
,
cmd_startIn
);
...
...
@@ -306,7 +324,7 @@ namespace OnlineStore.DeviceLibrary
paramList
.
Add
(
S_RFID
,
param
.
rfid
);
// string msg = cmd_startIn+cmd_spilt+param.PosId+cmd_spilt+param.PlateH+cmd_spilt+param.PlateW+cmd_spilt+"\r";
string
msg
=
ToParamStr
(
paramList
);
TcpClientBean
client
=
ClientMap
[
id
];
//
TcpClientBean client = ClientMap[id];
bool
result
=
SendStrToClient
(
client
,
msg
);
if
(!
result
)
{
...
...
@@ -323,28 +341,14 @@ namespace OnlineStore.DeviceLibrary
}
return
false
;
}
///// <summary>
///// 获取整个料仓的状态
///// </summary>
//public static Operation GetInStoreOperation(string message)
//{
// //构建发送给服务器的对象
// Operation lineOperation = new Operation();
// lineOperation.status = 1;
// lineOperation.seq = ConfigAppSettings.nextSeq();
// lineOperation.boxStatus = new Dictionary<int, BoxStatus>();
// lineOperation.alarmList = new List<AlarmInfo>();
// lineOperation.cid = LineServer.GetAllCID();
// lineOperation.op = 1;
// lineOperation.data = new Dictionary<string, string>() { { "code", message } };
// return lineOperation;
//}
public
static
bool
CheckInStorePos
(
int
id
,
InOutParam
param
)
{
try
{
if
(
ClientMap
.
ContainsKey
(
id
))
TcpClientBean
client
=
GetClientBean
(
id
);
if
(
client
!=
null
)
{
Dictionary
<
string
,
object
>
paramList
=
new
Dictionary
<
string
,
object
>();
paramList
.
Add
(
S_Cmd
,
cmd_checStartIn
);
...
...
@@ -356,7 +360,7 @@ namespace OnlineStore.DeviceLibrary
paramList
.
Add
(
S_RFID
,
param
.
rfid
);
// string msg = cmd_startIn+cmd_spilt+param.PosId+cmd_spilt+param.PlateH+cmd_spilt+param.PlateW+cmd_spilt+"\r";
string
msg
=
ToParamStr
(
paramList
);
TcpClientBean
client
=
ClientMap
[
id
];
//
TcpClientBean client = ClientMap[id];
bool
result
=
SendStrToClient
(
client
,
msg
);
if
(!
result
)
{
...
...
@@ -414,6 +418,31 @@ namespace OnlineStore.DeviceLibrary
ClientMap
.
Add
(
id
,
client
);
}
}
private
static
TcpClientBean
GetClientBean
(
int
id
)
{
if
(
ClientMap
.
ContainsKey
(
id
))
{
return
ClientMap
[
id
];
}
else
{
int
newId
=
id
;
if
(
id
.
Equals
(
19
))
{
newId
=
25
;
}
else
if
(
id
.
Equals
(
20
))
{
newId
=
26
;
}
if
(
ClientMap
.
ContainsKey
(
newId
))
{
return
ClientMap
[
newId
];
}
}
return
null
;
}
private
static
void
tcp_ReviceMsgEvent
(
TcpClientBean
client
,
string
msg
)
{
try
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论