Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
SO908-XLRStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 738813b5
由
张东亮
编写于
2021-09-14 09:02:09 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
存储机构-库位调试功能-待调试
1 个父辈
9b6571e1
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
351 行增加
和
47 行删除
source/DeviceLibrary/manager/StoreManager.cs
source/DeviceLibrary/storeBean/boxBean/BoxEqiup_Tongs.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_OutExecute.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Partial.cs
source/DeviceLibrary/storeBean/boxBean/BoxEquip_PosDebug.cs
source/DeviceLibrary/storeBean/boxBean/positionDebug/PositionDebugManager.cs
source/XLRStoreClient/FrmXLRStore.Designer.cs
source/XLRStoreClient/FrmXLRStore.cs
source/XLRStoreClient/boxForm/FrmPosDebug.cs
source/XLRStoreClient/boxForm/FrmPosResult.Designer.cs
source/XLRStoreClient/boxForm/FrmPosResult.cs
source/XLRStoreClient/boxForm/FrmPosResult.resx
source/XLRStoreClient/boxForm/userControl/UCStatusPanel.Designer.cs
source/XLRStoreClient/boxForm/userControl/UCStatusPanel.cs
source/DeviceLibrary/manager/StoreManager.cs
查看文件 @
738813b
...
@@ -20,6 +20,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -20,6 +20,7 @@ namespace OnlineStore.DeviceLibrary
//public static bool DisSecurityAccess = ConfigAppSettings.GetIntValue(Setting_Init.DisSecurityAccess).Equals(1);
//public static bool DisSecurityAccess = ConfigAppSettings.GetIntValue(Setting_Init.DisSecurityAccess).Equals(1);
public
static
bool
DisSecurityAccess
=
false
;
public
static
bool
DisSecurityAccess
=
false
;
public
static
bool
DisBoxSecurityAccess
=
false
;
public
static
bool
DisGetWare
=
false
;
public
static
bool
DisGetWare
=
false
;
public
static
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
public
static
bool
UseBuzzer
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
UseBuzzer
).
Equals
(
1
);
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEqiup_Tongs.cs
查看文件 @
738813b
...
@@ -67,11 +67,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -67,11 +67,13 @@ namespace OnlineStore.DeviceLibrary
/// <returns>匹配分值 -1:匹配失败 >=0:匹配成功</returns>
/// <returns>匹配分值 -1:匹配失败 >=0:匹配成功</returns>
unsafe
float
match
(
string
filename
,
out
string
pn
,
out
Bitmap
bitmap
)
unsafe
float
match
(
string
filename
,
out
string
pn
,
out
Bitmap
bitmap
)
{
{
bitmap
=
null
;
pn
=
""
;
try
{
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
temp_path
);
Directory
.
CreateDirectory
(
temp_path
);
bitmap
=
null
;
pn
=
""
;
Bitmap
a
=
new
Bitmap
(
filename
);
Bitmap
a
=
new
Bitmap
(
filename
);
Bitmap
b
=
new
Bitmap
(
224
,
224
,
PixelFormat
.
Format32bppArgb
);
Bitmap
b
=
new
Bitmap
(
224
,
224
,
PixelFormat
.
Format32bppArgb
);
...
@@ -96,9 +98,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -96,9 +98,19 @@ namespace OnlineStore.DeviceLibrary
score
=
score
*
100
;
score
=
score
*
100
;
return
score
;
return
score
;
}
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"match"
,
e
);
}
return
0
;
}
public
bool
MatchAndSaveImg
(
Bitmap
bitmap
,
string
imgname
)
public
bool
MatchAndSaveImg
(
Bitmap
bitmap
,
string
imgname
)
{
{
if
(
bitmap
==
null
)
return
false
;
try
{
var
score
=
match
(
bitmap
,
out
string
pn
,
out
Bitmap
bitmap1
);
var
score
=
match
(
bitmap
,
out
string
pn
,
out
Bitmap
bitmap1
);
var
pnpath
=
Path
.
Combine
(
$
"{temp_path}/{DateTime.Now.ToString("
yyyyMMdd
")}/"
,
score
>
Config
.
TongsDetectThreshold
?
"OK"
:
"NG"
);
var
pnpath
=
Path
.
Combine
(
$
"{temp_path}/{DateTime.Now.ToString("
yyyyMMdd
")}/"
,
score
>
Config
.
TongsDetectThreshold
?
"OK"
:
"NG"
);
Directory
.
CreateDirectory
(
pnpath
);
Directory
.
CreateDirectory
(
pnpath
);
...
@@ -107,6 +119,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,6 +119,12 @@ namespace OnlineStore.DeviceLibrary
bitmap
.
Dispose
();
bitmap
.
Dispose
();
return
score
>
Config
.
TongsDetectThreshold
;
return
score
>
Config
.
TongsDetectThreshold
;
}
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"MatchAndSaveImg"
,
e
);
}
return
false
;
}
/// <summary>
/// <summary>
/// 匹配抓手外观类型
/// 匹配抓手外观类型
/// </summary>
/// </summary>
...
@@ -120,6 +138,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -120,6 +138,10 @@ namespace OnlineStore.DeviceLibrary
Directory
.
CreateDirectory
(
temp_path
);
Directory
.
CreateDirectory
(
temp_path
);
bitmap
=
null
;
bitmap
=
null
;
pn
=
""
;
pn
=
""
;
if
(
inputImg
==
null
)
return
0
;
try
{
Bitmap
b
=
new
Bitmap
(
224
,
224
,
PixelFormat
.
Format32bppArgb
);
Bitmap
b
=
new
Bitmap
(
224
,
224
,
PixelFormat
.
Format32bppArgb
);
Graphics
g
=
Graphics
.
FromImage
(
b
);
Graphics
g
=
Graphics
.
FromImage
(
b
);
...
@@ -143,6 +165,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -143,6 +165,12 @@ namespace OnlineStore.DeviceLibrary
score
=
score
*
100
;
score
=
score
*
100
;
return
score
;
return
score
;
}
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"match"
,
e
);
}
return
0
;
}
/// <summary>
/// <summary>
/// 学习抓手外观
/// 学习抓手外观
/// </summary>
/// </summary>
...
@@ -150,6 +178,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -150,6 +178,8 @@ namespace OnlineStore.DeviceLibrary
/// <param name="pn">标识符</param>
/// <param name="pn">标识符</param>
public
unsafe
void
learn
(
string
filename
,
string
pn
)
public
unsafe
void
learn
(
string
filename
,
string
pn
)
{
{
try
{
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
temp_path
);
Directory
.
CreateDirectory
(
temp_path
);
...
@@ -174,6 +204,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -174,6 +204,11 @@ namespace OnlineStore.DeviceLibrary
b
.
UnlockBits
(
bitmapData
);
b
.
UnlockBits
(
bitmapData
);
b
.
Dispose
();
b
.
Dispose
();
}
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"learn"
,
e
);
}
}
/// <summary>
/// <summary>
/// 学习抓手外观
/// 学习抓手外观
/// </summary>
/// </summary>
...
@@ -181,6 +216,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -181,6 +216,10 @@ namespace OnlineStore.DeviceLibrary
/// <param name="pn">标识符</param>
/// <param name="pn">标识符</param>
public
unsafe
void
learn
(
Bitmap
inputimg
,
string
pn
)
public
unsafe
void
learn
(
Bitmap
inputimg
,
string
pn
)
{
{
if
(
inputimg
==
null
)
return
;
try
{
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
input_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
output_path
);
Directory
.
CreateDirectory
(
temp_path
);
Directory
.
CreateDirectory
(
temp_path
);
...
@@ -204,5 +243,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -204,5 +243,10 @@ namespace OnlineStore.DeviceLibrary
b
.
UnlockBits
(
bitmapData
);
b
.
UnlockBits
(
bitmapData
);
b
.
Dispose
();
b
.
Dispose
();
}
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"learn"
,
e
);
}
}
}
}
}
}
source/DeviceLibrary/storeBean/boxBean/BoxEquip.cs
查看文件 @
738813b
...
@@ -794,6 +794,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -794,6 +794,7 @@ namespace OnlineStore.DeviceLibrary
{
{
return
;
return
;
}
}
SecurityAccessProcess
();
if
(
runStatus
.
Equals
(
RunStatus
.
Runing
))
if
(
runStatus
.
Equals
(
RunStatus
.
Runing
))
{
{
ExecuteOutListProcess
();
ExecuteOutListProcess
();
...
@@ -948,7 +949,112 @@ namespace OnlineStore.DeviceLibrary
...
@@ -948,7 +949,112 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
门禁
//门禁状态:0正常。1=安全门禁打开,已停止运动
private
int
CurrSecurityAccess
=
0
;
protected
void
SecurityAccessProcess
()
{
try
{
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
LeftDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
RightDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
BackDoor_Limit
))
{
return
;
}
if
(
CurrSecurityAccess
.
Equals
(
0
))
{
if
(
StoreManager
.
DisBoxSecurityAccess
)
{
}
else
if
(
IOValue
(
IO_Type
.
LeftDoor_Limit
).
Equals
(
IO_VALUE
.
LOW
))
{
SecurityAccessStop
(
"左前门门禁"
);
}
else
if
(
IOValue
(
IO_Type
.
RightDoor_Limit
).
Equals
(
IO_VALUE
.
LOW
))
{
SecurityAccessStop
(
"右前门门禁"
);
}
else
if
(
IOValue
(
IO_Type
.
BackDoor_Limit
).
Equals
(
IO_VALUE
.
LOW
))
{
SecurityAccessStop
(
"后门门禁"
);
}
}
else
if
(
CurrSecurityAccess
.
Equals
(
1
))
{
if
(
IOValue
(
IO_Type
.
LeftDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
RightDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
)
&&
IOValue
(
IO_Type
.
BackDoor_Limit
).
Equals
(
IO_VALUE
.
HIGH
))
{
SecurityAccessReset
();
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
" 出错 :"
+
ex
.
ToString
());
}
}
private
void
SecurityAccessStop
(
string
doorname
)
{
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
LeftDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
RightDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
BackDoor_Limit
))
{
return
;
}
CurrSecurityAccess
=
1
;
if
(
alarmType
>
(
AlarmType
.
IoSingleTimeOut
))
{
return
;
}
LogUtil
.
info
(
$
"{Name} {doorname}被打开,停止当前运动{MoveInfo.MoveType},MoveStop={MoveStop},报警急停"
);
SetWarnMsg
(
$
"{doorname}被打开,报警急停"
);
Alarm
(
AlarmType
.
SuddenStop
);
}
private
void
SecurityAccessReset
()
{
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
LeftDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
RightDoor_Limit
))
{
return
;
}
if
(!
baseConfig
.
DIList
.
ContainsKey
(
IO_Type
.
BackDoor_Limit
))
{
return
;
}
CurrSecurityAccess
=
0
;
MoveStop
=
false
;
if
(
alarmType
>
(
AlarmType
.
IoSingleTimeOut
))
{
return
;
}
//光栅恢复处理
}
#
endregion
}
}
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_ConnectServerTimer.cs
查看文件 @
738813b
...
@@ -112,7 +112,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -112,7 +112,7 @@ namespace OnlineStore.DeviceLibrary
boxStatus
.
status
=
(
int
)
deviceStatus
;
boxStatus
.
status
=
(
int
)
deviceStatus
;
if
(
lastPosId
!=
""
)
if
(
lastPosId
!=
""
)
{
{
LogUtil
.
info
(
"给服务器发送出入库
完成
消息:"
+
Name
+
",status【"
+
deviceStatus
+
"】posId【"
+
lastPosId
+
"】"
);
LogUtil
.
info
(
"给服务器发送出入库消息:"
+
Name
+
",status【"
+
deviceStatus
+
"】posId【"
+
lastPosId
+
"】"
);
}
}
lastPosId
=
""
;
lastPosId
=
""
;
}
}
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_InExecute.cs
查看文件 @
738813b
...
@@ -323,12 +323,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -323,12 +323,12 @@ namespace OnlineStore.DeviceLibrary
case
StepEnum
.
SI_17_PushTray
:
case
StepEnum
.
SI_17_PushTray
:
MoveInfo
.
NextMoveStep
(
StepEnum
.
SI_18_PutTrayMiddle
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
SI_18_PutTrayMiddle
);
LogInfo
(
$
"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
LogInfo
(
$
"入库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
SaveSpecifiedImage
();
Bitmap
bitmap
=
AcqImage
(
CamPosSide
(
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
));
bool
rtn
=
MatchAndSaveImg
(
bitmap
,
$
"{CamPosSide(MoveInfo.MoveParam.PosInfo.PosId)}_{DateTime.Now.ToString("
HHmmss
")}"
);
string
res
=
rtn
?
"OK"
:
"NG"
;
LogInfo
(
$
"入库 {MoveInfo.SLog}:抓手检测结果:{res}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
PullAxis_Inout_To_P2_P4
();
PullAxis_Inout_To_P2_P4
();
SaveSpecifiedImage
();
//Bitmap bitmap = AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
//bool rtn = MatchAndSaveImg(bitmap, $"{DateTime.Now.ToString("HHmmss")}");
//string res = rtn ? "OK" : "NG";
//LogInfo($"入库 {MoveInfo.SLog}:抓手检测结果:{res}");
//PullAxis_UpdownToMiddleP2();
//PullAxis_UpdownToMiddleP2();
//if (CheckASide())
//if (CheckASide())
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_OutExecute.cs
查看文件 @
738813b
...
@@ -123,12 +123,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -123,12 +123,12 @@ namespace OnlineStore.DeviceLibrary
case
StepEnum
.
SO_11_PushTray
:
case
StepEnum
.
SO_11_PushTray
:
MoveInfo
.
NextMoveStep
(
StepEnum
.
SO_12_PutTrayMiddle
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
SO_12_PutTrayMiddle
);
LogInfo
(
$
"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
LogInfo
(
$
"出库 {MoveInfo.SLog}:推到抽屉提取点,料斗拉取进出轴到料屉提取点P2/P4[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
SaveSpecifiedImage
();
//Bitmap bitmap = AcqImage(CamPosSide(MoveInfo.MoveParam.PosInfo.PosId));
Bitmap
bitmap
=
AcqImage
(
CamPosSide
(
MoveInfo
.
MoveParam
.
PosInfo
.
PosId
));
bool
rtn
=
MatchAndSaveImg
(
bitmap
,
$
"{CamPosSide(MoveInfo.MoveParam.PosInfo.PosId)}_{DateTime.Now.ToString("
HHmmss
")}"
);
string
res
=
rtn
?
"OK"
:
"NG"
;
LogInfo
(
$
"出库 {MoveInfo.SLog}:抓手检测结果:{res}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
PullAxis_Inout_To_P2_P4
();
PullAxis_Inout_To_P2_P4
();
SaveSpecifiedImage
();
//bool rtn = MatchAndSaveImg(bitmap, $"{DateTime.Now.ToString("HHmmss")}");
//string res = rtn ? "OK" : "NG";
//LogInfo($"出库 {MoveInfo.SLog}:抓手检测结果:{res}");
//PullAxis_UpdownToMiddleP2();
//PullAxis_UpdownToMiddleP2();
//if (CheckASide())
//if (CheckASide())
...
...
source/DeviceLibrary/storeBean/boxBean/BoxEquip_Partial.cs
查看文件 @
738813b
...
@@ -1074,6 +1074,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1074,6 +1074,8 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
private
void
SaveSpecifiedImage
()
private
void
SaveSpecifiedImage
()
{
{
Task
.
Factory
.
StartNew
(
new
Action
(()
=>
{
if
(
CheckASide
())
if
(
CheckASide
())
{
{
SaveImage
(
"box_A"
);
SaveImage
(
"box_A"
);
...
@@ -1082,6 +1084,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1082,6 +1084,8 @@ namespace OnlineStore.DeviceLibrary
{
{
SaveImage
(
"box_B"
);
SaveImage
(
"box_B"
);
}
}
}));
}
}
}
}
}
}
source/DeviceLibrary/storeBean/boxBean/BoxEquip_PosDebug.cs
查看文件 @
738813b
...
@@ -36,17 +36,37 @@ namespace OnlineStore.DeviceLibrary
...
@@ -36,17 +36,37 @@ namespace OnlineStore.DeviceLibrary
PullAxis_Inout_To_P1
();
PullAxis_Inout_To_P1
();
}
}
//public void Test()
public
void
Test
()
//{
{
// while(!posDebugInfo.IsLastDrawer())
Random
random
=
new
Random
();
// {
Task
.
Factory
.
StartNew
(
new
Action
(
delegate
// while(!posDebugInfo.IsLastGrid())
{
// {
while
(!
posDebugInfo
.
IsLastDrawer
())
// posDebugInfo.NextGrid();
{
// }
while
(!
posDebugInfo
.
IsLastGrid
())
// posDebugInfo.NextDrawer();
{
// }
PosDebugResultManager
.
SetGridResult
(
posDebugInfo
.
CurGrid
,
1
);
//}
posDebugInfo
.
NextGrid
();
System
.
Threading
.
Thread
.
Sleep
(
500
);
}
PosDebugResultManager
.
SetGridResult
(
posDebugInfo
.
CurGrid
,
1
);
PosDebugResultManager
.
SetDrawerResult
(
posDebugInfo
.
CurDrawer
,
1
);
PosDebugResultManager
.
SetDrawerResultWithGrid
(
posDebugInfo
.
CurDrawer
);
posDebugInfo
.
NextDrawer
();
System
.
Threading
.
Thread
.
Sleep
(
500
);
}
while
(!
posDebugInfo
.
IsLastGrid
())
{
PosDebugResultManager
.
SetGridResult
(
posDebugInfo
.
CurGrid
,
1
);
//random.Next(0, 2)
posDebugInfo
.
NextGrid
();
System
.
Threading
.
Thread
.
Sleep
(
500
);
}
PosDebugResultManager
.
SetGridResult
(
posDebugInfo
.
CurGrid
,
1
);
PosDebugResultManager
.
SetDrawerResultWithGrid
(
posDebugInfo
.
CurDrawer
);
posDebugInfo
.
NextDrawer
();
}));
PosDebugResultManager
.
SaveResult
();
}
/// <summary>
/// <summary>
/// 更新移动信息
/// 更新移动信息
/// </summary>
/// </summary>
...
@@ -237,10 +257,10 @@ namespace OnlineStore.DeviceLibrary
...
@@ -237,10 +257,10 @@ namespace OnlineStore.DeviceLibrary
break
;
break
;
case
StepEnum
.
SP_18_UpDownBack
:
case
StepEnum
.
SP_18_UpDownBack
:
if
(
posDebugInfo
.
IsLastGrid
())
if
(
posDebugInfo
.
IsLastGrid
())
{
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
SP_19_CheckDrawerFinish
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
SP_19_CheckDrawerFinish
);
int
drawerRescode
=
PosDebugResultManager
.
SetDrawerResultWithGrid
(
posDebugInfo
.
CurDrawer
);
int
drawerRescode
=
PosDebugResultManager
.
SetDrawerResultWithGrid
(
posDebugInfo
.
CurDrawer
);
LogInfo
(
$
"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}{posDebugInfo.CurGrid}是抽屉的最后一个库位,统计抽屉结果:{drawerRescode}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
LogInfo
(
$
"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}{posDebugInfo.CurGrid}是抽屉的最后一个库位,统计抽屉结果:{drawerRescode}[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
}
}
else
else
...
@@ -284,7 +304,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -284,7 +304,7 @@ namespace OnlineStore.DeviceLibrary
break
;
break
;
case
StepEnum
.
SP_24_InoutBack
:
case
StepEnum
.
SP_24_InoutBack
:
if
(
posDebugInfo
.
IsLastDrawer
())
if
(
posDebugInfo
.
IsLastDrawer
())
{
{
MoveInfo
.
NextMoveStep
(
StepEnum
.
SP_26_ToBufferArea
);
MoveInfo
.
NextMoveStep
(
StepEnum
.
SP_26_ToBufferArea
);
LogInfo
(
$
"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}是最后一个抽屉,将料盘送回暂存区。旋转轴到水平点P2,行走机构到待机点P1,抽屉升降轴到待机点P1、移栽升降轴到下暂存区高点P4/P10[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
LogInfo
(
$
"库位调试 {MoveInfo.SLog}:{posDebugInfo.CurDrawer}是最后一个抽屉,将料盘送回暂存区。旋转轴到水平点P2,行走机构到待机点P1,抽屉升降轴到待机点P1、移栽升降轴到下暂存区高点P4/P10[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"
);
...
@@ -364,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -364,7 +384,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// <summary>
/// 当前料格
/// 当前料格
/// </summary>
/// </summary>
public
string
CurGrid
{
get
{
return
$
"{CurDrawer}{CurRowInDrawer
}{CurColInDrawer
}"
;
}
}
public
string
CurGrid
{
get
{
return
$
"{CurDrawer}{CurRowInDrawer
.ToString("
00
")}{CurColInDrawer.ToString("
00
")
}"
;
}
}
public
string
CID
{
get
;
private
set
;
}
public
string
CID
{
get
;
private
set
;
}
public
string
PosSide
{
get
;
set
;
}
=
"AA"
;
public
string
PosSide
{
get
;
set
;
}
=
"AA"
;
...
@@ -381,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -381,7 +401,7 @@ namespace OnlineStore.DeviceLibrary
public
int
EndDrawerCol
{
get
;
set
;
}
public
int
EndDrawerCol
{
get
;
set
;
}
public
int
EndRowInDrawer
{
get
;
set
;
}
public
int
EndRowInDrawer
{
get
;
set
;
}
public
int
EndColInDrawer
{
get
;
set
;
}
public
int
EndColInDrawer
{
get
;
set
;
}
public
void
SetDrawerParam
(
int
startrow
,
int
startcol
,
int
endrow
,
int
endcol
)
public
void
SetDrawerParam
(
int
startrow
,
int
startcol
,
int
endrow
,
int
endcol
)
{
{
CurDrawerRow
=
startrow
;
CurDrawerRow
=
startrow
;
PreDrawerRow
=
startrow
;
PreDrawerRow
=
startrow
;
...
@@ -440,6 +460,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -440,6 +460,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
void
NextGrid
()
public
void
NextGrid
()
{
{
PosDebugResultManager
.
SaveResult
();
if
((
CurColInDrawer
==
PreColInDrawer
&&
CurRowInDrawer
==
PreRowInDrawer
)
||
//第一个料格结束
if
((
CurColInDrawer
==
PreColInDrawer
&&
CurRowInDrawer
==
PreRowInDrawer
)
||
//第一个料格结束
(
CurRowInDrawer
==
PreRowInDrawer
&&
CurColInDrawer
>
PreColInDrawer
))
//同一层下一个,正向走
(
CurRowInDrawer
==
PreRowInDrawer
&&
CurColInDrawer
>
PreColInDrawer
))
//同一层下一个,正向走
{
{
...
@@ -512,6 +533,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -512,6 +533,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
void
NextDrawer
()
public
void
NextDrawer
()
{
{
PosDebugResultManager
.
SaveResult
();
if
((
CurDrawerCol
==
PreDrawerCol
&&
CurDrawerRow
==
PreDrawerRow
)
||
//第一个抽屉结束
if
((
CurDrawerCol
==
PreDrawerCol
&&
CurDrawerRow
==
PreDrawerRow
)
||
//第一个抽屉结束
(
CurDrawerRow
==
PreDrawerRow
&&
CurDrawerCol
>
PreDrawerCol
))
//同一层下一个,正向走
(
CurDrawerRow
==
PreDrawerRow
&&
CurDrawerCol
>
PreDrawerCol
))
//同一层下一个,正向走
{
{
...
@@ -557,7 +579,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -557,7 +579,7 @@ namespace OnlineStore.DeviceLibrary
{
{
if
(
CurDrawerRow
<
EndDrawerRow
)
//轴未到目标层
if
(
CurDrawerRow
<
EndDrawerRow
)
//轴未到目标层
{
{
if
(
CurDrawerCol
>
1
)
if
(
CurDrawerCol
>
1
)
{
{
PreDrawerCol
=
CurDrawerCol
;
PreDrawerCol
=
CurDrawerCol
;
CurDrawerCol
--;
CurDrawerCol
--;
...
...
source/DeviceLibrary/storeBean/boxBean/positionDebug/PositionDebugManager.cs
查看文件 @
738813b
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Linq
;
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
namespace
OnlineStore.DeviceLibrary
namespace
OnlineStore.DeviceLibrary
{
{
...
@@ -10,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -10,7 +11,7 @@ namespace OnlineStore.DeviceLibrary
{
{
public
static
List
<
DrawerResult
>
DrawerResults
;
public
static
List
<
DrawerResult
>
DrawerResults
;
public
static
bool
isInit
=
false
;
public
static
bool
isInit
=
false
;
static
string
filePath
=
Common
.
ConfigAppSettings
.
GetValue
(
Common
.
Setting_Init
.
ConfigPath_PosDebugInfo
);
static
string
filePath
=
Application
.
StartupPath
+
Common
.
ConfigAppSettings
.
GetValue
(
Common
.
Setting_Init
.
ConfigPath_PosDebugInfo
);
public
static
void
Init
(
List
<
string
>
posNumList
)
public
static
void
Init
(
List
<
string
>
posNumList
)
{
{
if
(!
System
.
IO
.
File
.
Exists
(
filePath
))
if
(!
System
.
IO
.
File
.
Exists
(
filePath
))
...
@@ -56,6 +57,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -56,6 +57,18 @@ namespace OnlineStore.DeviceLibrary
}
}
isInit
=
true
;
isInit
=
true
;
}
}
public
static
void
SaveResult
()
{
try
{
string
res
=
Common
.
JsonHelper
.
SerializeObject
(
DrawerResults
);
System
.
IO
.
File
.
WriteAllText
(
filePath
,
res
);
}
catch
(
Exception
e
)
{
Common
.
LogUtil
.
error
(
"SaveResult"
,
e
);
}
}
/// <summary>
/// <summary>
/// 获取抽屉调试结果
/// 获取抽屉调试结果
/// </summary>
/// </summary>
...
...
source/XLRStoreClient/FrmXLRStore.Designer.cs
查看文件 @
738813b
...
@@ -84,6 +84,7 @@
...
@@ -84,6 +84,7 @@
this
.
aGVCancelStateToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
aGVCancelStateToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
toolStripSeparator17
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
toolStripSeparator17
=
new
System
.
Windows
.
Forms
.
ToolStripSeparator
();
this
.
禁用安全光栅
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
禁用安全光栅
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
启用门禁
ToolStripMenuItem
=
new
System
.
Windows
.
Forms
.
ToolStripMenuItem
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabControl1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage1
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
this
.
tabPage2
.
SuspendLayout
();
...
@@ -535,7 +536,8 @@
...
@@ -535,7 +536,8 @@
this
.
toolStripSeparator25
,
this
.
toolStripSeparator25
,
this
.
aGVCancelStateToolStripMenuItem
,
this
.
aGVCancelStateToolStripMenuItem
,
this
.
toolStripSeparator17
,
this
.
toolStripSeparator17
,
this
.
禁用安全光栅
ToolStripMenuItem
});
this
.
禁用安全光栅
ToolStripMenuItem
,
this
.
启用门禁
ToolStripMenuItem
});
this
.
运行参数
ToolStripMenuItem
.
Name
=
"运行参数ToolStripMenuItem"
;
this
.
运行参数
ToolStripMenuItem
.
Name
=
"运行参数ToolStripMenuItem"
;
this
.
运行参数
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
86
,
25
);
this
.
运行参数
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
86
,
25
);
this
.
运行参数
ToolStripMenuItem
.
Text
=
"运行参数"
;
this
.
运行参数
ToolStripMenuItem
.
Text
=
"运行参数"
;
...
@@ -578,13 +580,20 @@
...
@@ -578,13 +580,20 @@
this
.
toolStripSeparator17
.
Size
=
new
System
.
Drawing
.
Size
(
203
,
6
);
this
.
toolStripSeparator17
.
Size
=
new
System
.
Drawing
.
Size
(
203
,
6
);
this
.
toolStripSeparator17
.
Visible
=
false
;
this
.
toolStripSeparator17
.
Visible
=
false
;
//
//
//
启
用安全光栅ToolStripMenuItem
//
禁
用安全光栅ToolStripMenuItem
//
//
this
.
禁用安全光栅
ToolStripMenuItem
.
Name
=
"
启
用安全光栅ToolStripMenuItem"
;
this
.
禁用安全光栅
ToolStripMenuItem
.
Name
=
"
禁
用安全光栅ToolStripMenuItem"
;
this
.
禁用安全光栅
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
206
,
26
);
this
.
禁用安全光栅
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
206
,
26
);
this
.
禁用安全光栅
ToolStripMenuItem
.
Text
=
"启用安全光栅"
;
this
.
禁用安全光栅
ToolStripMenuItem
.
Text
=
"启用安全光栅"
;
this
.
禁用安全光栅
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
启用安全光栅
ToolStripMenuItem_Click
);
this
.
禁用安全光栅
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
启用安全光栅
ToolStripMenuItem_Click
);
//
//
// 启用门禁ToolStripMenuItem
//
this
.
启用门禁
ToolStripMenuItem
.
Name
=
"启用门禁ToolStripMenuItem"
;
this
.
启用门禁
ToolStripMenuItem
.
Size
=
new
System
.
Drawing
.
Size
(
206
,
26
);
this
.
启用门禁
ToolStripMenuItem
.
Text
=
"启用门禁"
;
this
.
启用门禁
ToolStripMenuItem
.
Click
+=
new
System
.
EventHandler
(
this
.
启用门禁
ToolStripMenuItem_Click
);
//
// FrmXLRStore
// FrmXLRStore
//
//
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
None
;
...
@@ -674,6 +683,7 @@
...
@@ -674,6 +683,7 @@
private
EquipControl
ShelfAControl
;
private
EquipControl
ShelfAControl
;
private
EquipControl
ShelfBControl
;
private
EquipControl
ShelfBControl
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
禁用安全光栅
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
禁用安全光栅
ToolStripMenuItem
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
启用门禁
ToolStripMenuItem
;
}
}
}
}
source/XLRStoreClient/FrmXLRStore.cs
查看文件 @
738813b
...
@@ -61,6 +61,14 @@ namespace OnlineStore.XLRStore
...
@@ -61,6 +61,14 @@ namespace OnlineStore.XLRStore
{
{
禁用安全光栅
ToolStripMenuItem
.
Text
=
"禁用安全光栅"
;
禁用安全光栅
ToolStripMenuItem
.
Text
=
"禁用安全光栅"
;
}
}
if
(
StoreManager
.
DisBoxSecurityAccess
)
{
启用门禁
ToolStripMenuItem
.
Text
=
gouStr
+
"禁用门禁"
;
}
else
{
启用门禁
ToolStripMenuItem
.
Text
=
"禁用门禁"
;
}
//tabControl1.TabPages.Remove(tabPage5);
//tabControl1.TabPages.Remove(tabPage5);
timer1
.
Start
();
timer1
.
Start
();
}
}
...
@@ -740,5 +748,30 @@ namespace OnlineStore.XLRStore
...
@@ -740,5 +748,30 @@ namespace OnlineStore.XLRStore
}
}
LogUtil
.
info
(
Name
+
" 点击:"
+
禁用安全光栅
ToolStripMenuItem
.
Text
);
LogUtil
.
info
(
Name
+
" 点击:"
+
禁用安全光栅
ToolStripMenuItem
.
Text
);
}
}
private
void
启用门禁
ToolStripMenuItem_Click
(
object
sender
,
EventArgs
e
)
{
if
(!
LoadOk
)
{
return
;
}
bool
result
=
!
启用门禁
ToolStripMenuItem
.
Text
.
Contains
(
gouStr
);
if
(
result
.
Equals
(
StoreManager
.
DisBoxSecurityAccess
))
{
return
;
}
StoreManager
.
DisBoxSecurityAccess
=
result
;
//ConfigAppSettings.SaveValue(Setting_Init.DisSecurityAccess, (StoreManager.DisSecurityAccess ? 1 : 0));
if
(
result
)
{
启用门禁
ToolStripMenuItem
.
Text
=
gouStr
+
" 禁用门禁"
;
}
else
{
启用门禁
ToolStripMenuItem
.
Text
=
"禁用门禁"
;
}
LogUtil
.
info
(
Name
+
" 点击:"
+
启用门禁
ToolStripMenuItem
.
Text
);
}
}
}
}
}
source/XLRStoreClient/boxForm/FrmPosDebug.cs
查看文件 @
738813b
...
@@ -22,7 +22,7 @@ namespace OnlineStore.XLRStore
...
@@ -22,7 +22,7 @@ namespace OnlineStore.XLRStore
BoxEquip
boxEquip
;
BoxEquip
boxEquip
;
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
{
{
if
(
MessageBox
.
Show
(
"是否开始库位调试?"
,
"提示"
,
MessageBoxButtons
.
OKCancel
).
Equals
(
MessageBoxButtons
.
OK
))
if
(
MessageBox
.
Show
(
"是否开始库位调试?"
,
"提示"
,
MessageBoxButtons
.
YesNo
).
Equals
(
DialogResult
.
Yes
))
{
{
boxEquip
.
posDebugInfo
.
IsBreak
=
false
;
boxEquip
.
posDebugInfo
.
IsBreak
=
false
;
int
startDrawerRow
=
int
.
Parse
(
txtStartDrawerRow
.
Text
);
int
startDrawerRow
=
int
.
Parse
(
txtStartDrawerRow
.
Text
);
...
@@ -36,6 +36,7 @@ namespace OnlineStore.XLRStore
...
@@ -36,6 +36,7 @@ namespace OnlineStore.XLRStore
int
endColInDrawer
=
int
.
Parse
(
txtEndColInDrawer
.
Text
);
int
endColInDrawer
=
int
.
Parse
(
txtEndColInDrawer
.
Text
);
boxEquip
.
posDebugInfo
.
SetDrawerParam
(
startDrawerRow
,
startDrawerCol
,
endDrawerRow
,
endDrawerCol
);
boxEquip
.
posDebugInfo
.
SetDrawerParam
(
startDrawerRow
,
startDrawerCol
,
endDrawerRow
,
endDrawerCol
);
boxEquip
.
posDebugInfo
.
SetGridParam
(
startRowInDrawer
,
startColInDrawer
,
endRowInDrawer
,
endColInDrawer
);
boxEquip
.
posDebugInfo
.
SetGridParam
(
startRowInDrawer
,
startColInDrawer
,
endRowInDrawer
,
endColInDrawer
);
boxEquip
.
Test
();
}
}
}
}
...
...
source/XLRStoreClient/boxForm/FrmPosResult.Designer.cs
查看文件 @
738813b
...
@@ -29,6 +29,7 @@ namespace OnlineStore.XLRStore
...
@@ -29,6 +29,7 @@ namespace OnlineStore.XLRStore
/// </summary>
/// </summary>
private
void
InitializeComponent
()
private
void
InitializeComponent
()
{
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tableLayoutPanel1
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox2
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
tlpPos
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tlpPos
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
...
@@ -38,6 +39,7 @@ namespace OnlineStore.XLRStore
...
@@ -38,6 +39,7 @@ namespace OnlineStore.XLRStore
this
.
tlpDrawerA
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tlpDrawerA
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tlpDrawerB
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
tlpDrawerB
=
new
System
.
Windows
.
Forms
.
TableLayoutPanel
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
tableLayoutPanel1
.
SuspendLayout
();
this
.
tableLayoutPanel1
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox2
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
...
@@ -59,7 +61,7 @@ namespace OnlineStore.XLRStore
...
@@ -59,7 +61,7 @@ namespace OnlineStore.XLRStore
this
.
tableLayoutPanel1
.
RowCount
=
1
;
this
.
tableLayoutPanel1
.
RowCount
=
1
;
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
100F
));
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
100F
));
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Absolute
,
20F
));
this
.
tableLayoutPanel1
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Absolute
,
20F
));
this
.
tableLayoutPanel1
.
Size
=
new
System
.
Drawing
.
Size
(
1004
,
721
);
this
.
tableLayoutPanel1
.
Size
=
new
System
.
Drawing
.
Size
(
1004
,
689
);
this
.
tableLayoutPanel1
.
TabIndex
=
0
;
this
.
tableLayoutPanel1
.
TabIndex
=
0
;
//
//
// groupBox2
// groupBox2
...
@@ -68,7 +70,7 @@ namespace OnlineStore.XLRStore
...
@@ -68,7 +70,7 @@ namespace OnlineStore.XLRStore
this
.
groupBox2
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
groupBox2
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
584
,
3
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
584
,
3
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
417
,
715
);
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
417
,
683
);
this
.
groupBox2
.
TabIndex
=
1
;
this
.
groupBox2
.
TabIndex
=
1
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"库位结果"
;
this
.
groupBox2
.
Text
=
"库位结果"
;
...
@@ -82,7 +84,7 @@ namespace OnlineStore.XLRStore
...
@@ -82,7 +84,7 @@ namespace OnlineStore.XLRStore
this
.
tlpPos
.
Name
=
"tlpPos"
;
this
.
tlpPos
.
Name
=
"tlpPos"
;
this
.
tlpPos
.
RowCount
=
1
;
this
.
tlpPos
.
RowCount
=
1
;
this
.
tlpPos
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tlpPos
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tlpPos
.
Size
=
new
System
.
Drawing
.
Size
(
411
,
6
95
);
this
.
tlpPos
.
Size
=
new
System
.
Drawing
.
Size
(
411
,
6
63
);
this
.
tlpPos
.
TabIndex
=
1
;
this
.
tlpPos
.
TabIndex
=
1
;
//
//
// groupBox1
// groupBox1
...
@@ -91,7 +93,7 @@ namespace OnlineStore.XLRStore
...
@@ -91,7 +93,7 @@ namespace OnlineStore.XLRStore
this
.
groupBox1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
groupBox1
.
Dock
=
System
.
Windows
.
Forms
.
DockStyle
.
Fill
;
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
groupBox1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
3
);
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Name
=
"groupBox1"
;
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
575
,
715
);
this
.
groupBox1
.
Size
=
new
System
.
Drawing
.
Size
(
575
,
683
);
this
.
groupBox1
.
TabIndex
=
0
;
this
.
groupBox1
.
TabIndex
=
0
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"抽屉结果"
;
this
.
groupBox1
.
Text
=
"抽屉结果"
;
...
@@ -104,7 +106,7 @@ namespace OnlineStore.XLRStore
...
@@ -104,7 +106,7 @@ namespace OnlineStore.XLRStore
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
tabControl1
.
Location
=
new
System
.
Drawing
.
Point
(
3
,
17
);
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
Name
=
"tabControl1"
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
SelectedIndex
=
0
;
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
569
,
6
95
);
this
.
tabControl1
.
Size
=
new
System
.
Drawing
.
Size
(
569
,
6
63
);
this
.
tabControl1
.
TabIndex
=
1
;
this
.
tabControl1
.
TabIndex
=
1
;
//
//
// tabPage1
// tabPage1
...
@@ -113,7 +115,7 @@ namespace OnlineStore.XLRStore
...
@@ -113,7 +115,7 @@ namespace OnlineStore.XLRStore
this
.
tabPage1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
22
);
this
.
tabPage1
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
22
);
this
.
tabPage1
.
Name
=
"tabPage1"
;
this
.
tabPage1
.
Name
=
"tabPage1"
;
this
.
tabPage1
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage1
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage1
.
Size
=
new
System
.
Drawing
.
Size
(
561
,
6
69
);
this
.
tabPage1
.
Size
=
new
System
.
Drawing
.
Size
(
561
,
6
37
);
this
.
tabPage1
.
TabIndex
=
0
;
this
.
tabPage1
.
TabIndex
=
0
;
this
.
tabPage1
.
Text
=
"A面"
;
this
.
tabPage1
.
Text
=
"A面"
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage1
.
UseVisualStyleBackColor
=
true
;
...
@@ -127,7 +129,7 @@ namespace OnlineStore.XLRStore
...
@@ -127,7 +129,7 @@ namespace OnlineStore.XLRStore
this
.
tlpDrawerA
.
Name
=
"tlpDrawerA"
;
this
.
tlpDrawerA
.
Name
=
"tlpDrawerA"
;
this
.
tlpDrawerA
.
RowCount
=
1
;
this
.
tlpDrawerA
.
RowCount
=
1
;
this
.
tlpDrawerA
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tlpDrawerA
.
RowStyles
.
Add
(
new
System
.
Windows
.
Forms
.
RowStyle
(
System
.
Windows
.
Forms
.
SizeType
.
Percent
,
50F
));
this
.
tlpDrawerA
.
Size
=
new
System
.
Drawing
.
Size
(
555
,
6
63
);
this
.
tlpDrawerA
.
Size
=
new
System
.
Drawing
.
Size
(
555
,
6
31
);
this
.
tlpDrawerA
.
TabIndex
=
0
;
this
.
tlpDrawerA
.
TabIndex
=
0
;
//
//
// tabPage2
// tabPage2
...
@@ -153,11 +155,16 @@ namespace OnlineStore.XLRStore
...
@@ -153,11 +155,16 @@ namespace OnlineStore.XLRStore
this
.
tlpDrawerB
.
Size
=
new
System
.
Drawing
.
Size
(
555
,
663
);
this
.
tlpDrawerB
.
Size
=
new
System
.
Drawing
.
Size
(
555
,
663
);
this
.
tlpDrawerB
.
TabIndex
=
1
;
this
.
tlpDrawerB
.
TabIndex
=
1
;
//
//
// timer1
//
this
.
timer1
.
Interval
=
1000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
// FrmPosResult
// FrmPosResult
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1004
,
721
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
1004
,
689
);
this
.
Controls
.
Add
(
this
.
tableLayoutPanel1
);
this
.
Controls
.
Add
(
this
.
tableLayoutPanel1
);
this
.
MaximizeBox
=
false
;
this
.
MaximizeBox
=
false
;
this
.
Name
=
"FrmPosResult"
;
this
.
Name
=
"FrmPosResult"
;
...
@@ -183,5 +190,6 @@ namespace OnlineStore.XLRStore
...
@@ -183,5 +190,6 @@ namespace OnlineStore.XLRStore
private
System
.
Windows
.
Forms
.
TabPage
tabPage1
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage1
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage2
;
private
System
.
Windows
.
Forms
.
TabPage
tabPage2
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tlpDrawerB
;
private
System
.
Windows
.
Forms
.
TableLayoutPanel
tlpDrawerB
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
source/XLRStoreClient/boxForm/FrmPosResult.cs
查看文件 @
738813b
...
@@ -15,21 +15,28 @@ namespace OnlineStore.XLRStore
...
@@ -15,21 +15,28 @@ namespace OnlineStore.XLRStore
{
{
public
FrmPosResult
()
public
FrmPosResult
()
{
{
CheckForIllegalCrossThreadCalls
=
false
;
boxEquip
=
StoreManager
.
XLRStore
.
boxEquip
;
boxEquip
=
StoreManager
.
XLRStore
.
boxEquip
;
DrawerResults
=
PosDebugResultManager
.
DrawerResults
;
DrawerResults
=
PosDebugResultManager
.
DrawerResults
;
InitializeComponent
();
InitializeComponent
();
LoadDrawerList
();
LoadDrawerList
();
timer1
.
Enabled
=
true
;
}
}
List
<
DrawerResult
>
DrawerResults
;
List
<
DrawerResult
>
DrawerResults
;
BoxEquip
boxEquip
;
BoxEquip
boxEquip
;
protected
Dictionary
<
string
,
UCStatusPanel
>
PosControlList
=
new
Dictionary
<
string
,
UCStatusPanel
>();
protected
Dictionary
<
string
,
UCStatusPanel
>
DrawerControlList
=
new
Dictionary
<
string
,
UCStatusPanel
>();
protected
Dictionary
<
string
,
UCStatusPanel
>
DrawerControlList
=
new
Dictionary
<
string
,
UCStatusPanel
>();
private
void
LoadDrawerList
()
private
void
LoadDrawerList
()
{
{
this
.
tlpDrawerA
.
RowStyles
.
Clear
();
this
.
tlpDrawerA
.
RowStyles
.
Clear
();
this
.
tlpDrawerA
.
ColumnStyles
.
Clear
();
this
.
tlpDrawerA
.
ColumnStyles
.
Clear
();
this
.
tlpDrawerA
.
CellBorderStyle
=
TableLayoutPanelCellBorderStyle
.
OutsetPartial
;
this
.
tlpDrawerA
.
RowCount
=
boxEquip
.
Config
.
Drawer_Rows
;
this
.
tlpDrawerA
.
RowCount
=
boxEquip
.
Config
.
Drawer_Rows
;
this
.
tlpDrawerA
.
ColumnCount
=
boxEquip
.
Config
.
Drawer_Columns
;
this
.
tlpDrawerA
.
ColumnCount
=
boxEquip
.
Config
.
Drawer_Columns
;
this
.
tlpDrawerA
.
Height
=
40
*
this
.
tlpDrawerA
.
RowCount
;
this
.
tlpDrawerA
.
Width
=
90
*
this
.
tlpDrawerA
.
ColumnCount
;
string
cid
=
boxEquip
.
Config
.
CID
;
string
cid
=
boxEquip
.
Config
.
CID
;
selectedDrawer
=
$
"{cid}AA{"
01
"}{"
01
"}"
;
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Drawer_Rows
;
rowindex
++)
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Drawer_Rows
;
rowindex
++)
{
{
tlpDrawerA
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
tlpDrawerA
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
...
@@ -37,8 +44,9 @@ namespace OnlineStore.XLRStore
...
@@ -37,8 +44,9 @@ namespace OnlineStore.XLRStore
{
{
tlpDrawerA
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
tlpDrawerA
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
UCStatusPanel
control
=
new
UCStatusPanel
();
UCStatusPanel
control
=
new
UCStatusPanel
();
control
.
ControlName
=
$
"{cid}AA{(rowindex
+1).ToString("
00
")}{(colindex+
1).ToString("
00
")}"
;
control
.
ControlName
=
$
"{cid}AA{(rowindex
+ 1).ToString("
00
")}{(colindex +
1).ToString("
00
")}"
;
control
.
Click
+=
Control_Click
;
control
.
Click
+=
Control_Click
;
control
.
Dock
=
DockStyle
.
Fill
;
this
.
tlpDrawerA
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
this
.
tlpDrawerA
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
DrawerControlList
.
Add
(
control
.
ControlName
,
control
);
DrawerControlList
.
Add
(
control
.
ControlName
,
control
);
}
}
...
@@ -46,8 +54,11 @@ namespace OnlineStore.XLRStore
...
@@ -46,8 +54,11 @@ namespace OnlineStore.XLRStore
this
.
tlpDrawerB
.
RowStyles
.
Clear
();
this
.
tlpDrawerB
.
RowStyles
.
Clear
();
this
.
tlpDrawerB
.
ColumnStyles
.
Clear
();
this
.
tlpDrawerB
.
ColumnStyles
.
Clear
();
this
.
tlpDrawerB
.
CellBorderStyle
=
TableLayoutPanelCellBorderStyle
.
OutsetPartial
;
this
.
tlpDrawerB
.
RowCount
=
boxEquip
.
Config
.
Drawer_Rows
;
this
.
tlpDrawerB
.
RowCount
=
boxEquip
.
Config
.
Drawer_Rows
;
this
.
tlpDrawerB
.
ColumnCount
=
boxEquip
.
Config
.
Drawer_Columns
;
this
.
tlpDrawerB
.
ColumnCount
=
boxEquip
.
Config
.
Drawer_Columns
;
this
.
tlpDrawerB
.
Height
=
40
*
this
.
tlpDrawerB
.
RowCount
;
this
.
tlpDrawerB
.
Width
=
90
*
this
.
tlpDrawerB
.
ColumnCount
;
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Drawer_Rows
;
rowindex
++)
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Drawer_Rows
;
rowindex
++)
{
{
tlpDrawerB
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
tlpDrawerB
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
...
@@ -55,8 +66,9 @@ namespace OnlineStore.XLRStore
...
@@ -55,8 +66,9 @@ namespace OnlineStore.XLRStore
{
{
tlpDrawerB
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
tlpDrawerB
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
UCStatusPanel
control
=
new
UCStatusPanel
();
UCStatusPanel
control
=
new
UCStatusPanel
();
control
.
ControlName
=
$
"{cid}BB{(rowindex
+1).ToString("
00
")}{(colindex+
1).ToString("
00
")}"
;
control
.
ControlName
=
$
"{cid}BB{(rowindex
+ 1).ToString("
00
")}{(colindex +
1).ToString("
00
")}"
;
control
.
Click
+=
Control_Click
;
control
.
Click
+=
Control_Click
;
control
.
Dock
=
DockStyle
.
Fill
;
this
.
tlpDrawerB
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
this
.
tlpDrawerB
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
DrawerControlList
.
Add
(
control
.
ControlName
,
control
);
DrawerControlList
.
Add
(
control
.
ControlName
,
control
);
}
}
...
@@ -64,9 +76,12 @@ namespace OnlineStore.XLRStore
...
@@ -64,9 +76,12 @@ namespace OnlineStore.XLRStore
this
.
tlpPos
.
RowStyles
.
Clear
();
this
.
tlpPos
.
RowStyles
.
Clear
();
this
.
tlpPos
.
ColumnStyles
.
Clear
();
this
.
tlpPos
.
ColumnStyles
.
Clear
();
this
.
tlpPos
.
CellBorderStyle
=
TableLayoutPanelCellBorderStyle
.
OutsetPartial
;
this
.
tlpPos
.
AutoScroll
=
true
;
this
.
tlpPos
.
AutoScroll
=
true
;
this
.
tlpPos
.
RowCount
=
boxEquip
.
Config
.
Cols_In_Drawer
;
this
.
tlpPos
.
RowCount
=
boxEquip
.
Config
.
Cols_In_Drawer
;
this
.
tlpPos
.
ColumnCount
=
boxEquip
.
Config
.
Rows_In_Drawer
;
this
.
tlpPos
.
ColumnCount
=
boxEquip
.
Config
.
Rows_In_Drawer
;
this
.
tlpPos
.
Height
=
40
*
this
.
tlpPos
.
RowCount
;
this
.
tlpPos
.
Width
=
90
*
this
.
tlpPos
.
ColumnCount
;
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Cols_In_Drawer
;
rowindex
++)
for
(
int
rowindex
=
0
;
rowindex
<
boxEquip
.
Config
.
Cols_In_Drawer
;
rowindex
++)
{
{
tlpPos
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
tlpPos
.
RowStyles
.
Add
(
new
RowStyle
(
SizeType
.
Absolute
,
38
));
...
@@ -74,8 +89,10 @@ namespace OnlineStore.XLRStore
...
@@ -74,8 +89,10 @@ namespace OnlineStore.XLRStore
{
{
tlpPos
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
tlpPos
.
ColumnStyles
.
Add
(
new
ColumnStyle
(
SizeType
.
Absolute
,
87
));
UCStatusPanel
control
=
new
UCStatusPanel
();
UCStatusPanel
control
=
new
UCStatusPanel
();
control
.
ControlName
=
$
"{(colindex+1).ToString("
00
")}{(rowindex+1).ToString("
00
")}"
;
control
.
ControlName
=
$
"{(colindex + 1).ToString("
00
")}{(rowindex + 1).ToString("
00
")}"
;
control
.
Dock
=
DockStyle
.
Fill
;
this
.
tlpPos
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
this
.
tlpPos
.
Controls
.
Add
(
control
,
colindex
,
rowindex
);
PosControlList
.
Add
(
control
.
ControlName
,
control
);
}
}
}
}
this
.
SuspendLayout
();
this
.
SuspendLayout
();
...
@@ -83,7 +100,44 @@ namespace OnlineStore.XLRStore
...
@@ -83,7 +100,44 @@ namespace OnlineStore.XLRStore
private
void
Control_Click
(
object
sender
,
EventArgs
e
)
private
void
Control_Click
(
object
sender
,
EventArgs
e
)
{
{
throw
new
NotImplementedException
();
UCStatusPanel
statusPanel
=
sender
as
UCStatusPanel
;
if
(
statusPanel
!=
null
)
{
selectedDrawer
=
statusPanel
.
ControlName
;
UpdateInfosInDrawer
(
statusPanel
.
ControlName
);
}
}
public
string
selectedDrawer
=
""
;
private
void
UpdateInfosInDrawer
(
string
drawername
)
{
groupBox2
.
Text
=
$
"{drawername}库位结果"
;
foreach
(
var
item
in
PosControlList
.
Values
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
Append
(
drawername
);
sb
.
Append
(
item
.
ControlName
);
item
.
ResultCode
=
PosDebugResultManager
.
GetGridResult
(
sb
.
ToString
());
item
.
ShowResult
();
}
}
private
void
UpdateDrawerInfos
()
{
foreach
(
var
item
in
DrawerControlList
.
Values
)
{
item
.
ResultCode
=
PosDebugResultManager
.
GetDrawerResult
(
item
.
ControlName
);
item
.
ShowResult
();
}
}
bool
inUpdate
=
false
;
private
void
timer1_Tick
(
object
sender
,
EventArgs
e
)
{
if
(
inUpdate
)
return
;
inUpdate
=
true
;
UpdateDrawerInfos
();
if
(!
selectedDrawer
.
Equals
(
""
))
UpdateInfosInDrawer
(
selectedDrawer
);
inUpdate
=
false
;
}
}
}
}
}
}
source/XLRStoreClient/boxForm/FrmPosResult.resx
查看文件 @
738813b
...
@@ -117,4 +117,7 @@
...
@@ -117,4 +117,7 @@
<resheader name="writer">
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
</root>
\ No newline at end of file
\ No newline at end of file
source/XLRStoreClient/boxForm/userControl/UCStatusPanel.Designer.cs
查看文件 @
738813b
...
@@ -42,6 +42,7 @@ namespace OnlineStore.XLRStore
...
@@ -42,6 +42,7 @@ namespace OnlineStore.XLRStore
this
.
lblStatus
.
TabIndex
=
0
;
this
.
lblStatus
.
TabIndex
=
0
;
this
.
lblStatus
.
Text
=
"05BB0101"
;
this
.
lblStatus
.
Text
=
"05BB0101"
;
this
.
lblStatus
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblStatus
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblStatus
.
Click
+=
new
System
.
EventHandler
(
this
.
lblStatus_Click
);
//
//
// UCStatusPanel
// UCStatusPanel
//
//
...
...
source/XLRStoreClient/boxForm/userControl/UCStatusPanel.cs
查看文件 @
738813b
...
@@ -35,5 +35,9 @@ namespace OnlineStore.XLRStore
...
@@ -35,5 +35,9 @@ namespace OnlineStore.XLRStore
}
}
}
}
private
void
lblStatus_Click
(
object
sender
,
EventArgs
e
)
{
this
.
OnClick
(
e
);
}
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论