Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
1069_MIMO_PlUS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9734331e
由
张东亮
编写于
2023-10-12 16:45:01 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入库高度计算逻辑更改
1 个父辈
20bd8c63
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
110 行增加
和
26 行删除
Common/Setting_Init.cs
DeviceLibrary/DeviceLibrary/AxisBean.cs
DeviceLibrary/theMachine/MainMachine.cs
DeviceLibrary/theMachine/MainMachine_Clamp.cs
DeviceLibrary/theMachine/MainMachine_String.cs
Common/Setting_Init.cs
查看文件 @
9734331
...
...
@@ -3,7 +3,7 @@ using System;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
namespace
OnlineStore.Common
{
...
...
@@ -18,8 +18,8 @@ namespace OnlineStore.Common
/// <summary>
/// 系统主界面标题
/// </summary>
public
static
string
App_Title
=
"App_Title"
;
public
static
string
App_Title
=
"App_Title"
;
/// <summary>
/// 摄像机名称
/// </summary>
...
...
@@ -38,11 +38,30 @@ namespace OnlineStore.Common
public
static
string
FixBuffInfo
=
"FixBuffInfo"
;
[
MyConfigComment
(
"进出轴运动负载阈值"
)]
public
static
MyConfig
<
float
>
Device_InOutMaxLoadRate
=
50
;
public
static
MyConfig
<
float
>
Device_InOutMaxLoadRate
=
50
;
[
MyConfigComment
(
"管理员密码"
)]
public
static
MyConfig
<
string
>
User_AdminPassword
=
"123456"
;
[
MyConfigComment
(
"启用管理员密码"
)]
public
static
MyConfig
<
bool
>
User_Enable
=
false
;
#
region
料盘高度计算参数
[
MyConfigComment
(
"启用自定义厚度计算策略"
)]
public
static
MyConfig
<
bool
>
Switch_UseCustHeightList
=
true
;
/// <summary>
/// 宽度15料盘,厚度自减mm
/// </summary>
[
MyConfigComment
(
"宽度15料盘,厚度自减mm"
)]
public
static
MyConfig
<
int
>
Param_CalHeight_Width15HeightSubVal
=
2
;
/// <summary>
/// 宽度13料盘,厚度自减mm
/// </summary>
[
MyConfigComment
(
"宽度13料盘,厚度自减mm"
)]
public
static
MyConfig
<
int
>
Param_CalHeight_Width13HeightSubVal
=
1
;
[
MyConfigComment
(
"如果计算出的厚度小于指定值,都归类为8mm"
)]
public
static
MyConfig
<
int
>
Param_CalHeight_Height8MaxVal
=
12
;
[
MyConfigComment
(
"自定义厚度列表"
)]
public
static
MyConfig
<
string
[
]>
Param_CalHeight_HeightList
=
new
string
[]
{
"12=12#16"
,
"16=16#24"
,
"24=24#32"
,
"32=32#44"
,
"44=44#56"
,
"56=56#60"
};
#
endregion
}
}
DeviceLibrary/DeviceLibrary/AxisBean.cs
查看文件 @
9734331
...
...
@@ -160,6 +160,7 @@ namespace DeviceLibrary
var
DelSpeed
=
Config
.
DelSpeed
>
0
?
Config
.
DelSpeed
:
targetSpeed
*
4
;
AxisManager
.
AbsMove
(
Config
.
DeviceName
,
Config
.
GetAxisValue
(),
targetPosition
,
targetSpeed
,
AddSpeed
,
DelSpeed
);
// Config.AddSpeed, Config.DelSpeed);
}
LogUtil
.
info
(
AxisName
+
$
" AbsMove:{targetPosition},{targetSpeed}"
);
}
public
void
SpeedMove
(
int
targetSpeed
)
...
...
DeviceLibrary/theMachine/MainMachine.cs
查看文件 @
9734331
...
...
@@ -646,11 +646,11 @@ namespace DeviceLibrary
//ok = false;
StringDoorSuddenStop
();
}
//else if (!lastString
SafetyStatus)
//
{
//
StringDoor.ResumeSingle();
// lastString
SafetyStatus = true;
//
}
else
if
(!
lastStringDoor
SafetyStatus
)
{
//
StringDoor.ResumeSingle();
lastStringDoor
SafetyStatus
=
true
;
}
}
if
(!
ConfigHelper
.
Config
.
Get
(
"Device_Disable_DoorSafeCheck"
,
false
))
{
...
...
@@ -711,9 +711,10 @@ namespace DeviceLibrary
}
}
}
bool
lastStringDoorSafetyStatus
=
true
;
void
StringDoorSuddenStop
()
{
//if (lastSafeCheck
Status)
if
(
lastStringDoorSafety
Status
)
{
AxisBean
axis
=
StringDoor
.
axisBean
;
AxisBean
.
StopMultiAxis
(
new
List
<
AxisBean
>
{
axis
});
...
...
@@ -723,6 +724,7 @@ namespace DeviceLibrary
{
ResetMoveInfo
.
NewMove
(
MoveStep
.
H01_HomeReset
);
}
lastStringDoorSafetyStatus
=
false
;
}
}
/// <summary>
...
...
DeviceLibrary/theMachine/MainMachine_Clamp.cs
查看文件 @
9734331
...
...
@@ -104,9 +104,9 @@ namespace DeviceLibrary
break
;
case
MoveStep
.
ReelClamp_04
:
ClampMoveInfo
.
NextMoveStep
(
MoveStep
.
ReelClamp_05
);
ClampMoveInfo
.
log
(
$
"关闭翻板门,检测盘宽"
);
//CylinderMove(ClampMoveInfo, IO_Type.StringPosChecker_Home, IO_Type.StringPosChecker_Work, IO_VALUE.HIGH);
ClampMoveInfo
.
MoveParam
.
PlateW
=
GetWidth
();
ClampMoveInfo
.
log
(
$
"关闭翻板门,检测盘宽={ClampMoveInfo.MoveParam.PlateW}"
);
CloseFlipDoor
(
ClampMoveInfo
);
break
;
case
MoveStep
.
ReelClamp_05
:
...
...
@@ -122,8 +122,8 @@ namespace DeviceLibrary
else
{
ClampErrorCount
=
0
;
ReelGetted
();
ClampMoveInfo
.
log
(
$
"检测到盘,盘宽:{ClampMoveInfo.MoveParam.PlateW},通知料串料已取走"
);
ReelGetted
();
}
break
;
case
MoveStep
.
ReelClamp_WaitGaugeHeight
:
...
...
DeviceLibrary/theMachine/MainMachine_String.cs
查看文件 @
9734331
...
...
@@ -217,7 +217,7 @@ namespace DeviceLibrary
StringState
=
StringStateE
.
OutStore
;
if
(
ConfigHelper
.
Config
.
Get
(
"Device_String_StandbyAtBottom"
,
true
)
&&
OutStoreJobList
.
Count
==
0
&&
ServerCM
.
queueTaskCount
<=
0
&&
boxTransport
.
IsComplateOrFree
)
{
SetReelHeight
(
GetHeight
(
String
MoveInfo
));
SetReelHeight
(
GetHeight
(
Clamp
MoveInfo
));
StringMoveInfo
.
log
(
$
"当前空料串, 并且没有出库任务, 料串下降待机"
);
StringMoveInfo
.
NextMoveStep
(
MoveStep
.
StringOut_01
);
}
...
...
@@ -572,6 +572,9 @@ namespace DeviceLibrary
string
LastCode
=
""
;
private
int
GetHeight
(
MoveInfo
moveInfo
)
{
int
w15SubVal
=
Setting_Init
.
Param_CalHeight_Width15HeightSubVal
;
int
w13SubVal
=
Setting_Init
.
Param_CalHeight_Width13HeightSubVal
;
int
w8MaxVal
=
Setting_Init
.
Param_CalHeight_Height8MaxVal
;
int
LastHeight
=
0
;
int
AxisChangeValue
=
Config
.
Batch_PoToMM
;
//计算高度
...
...
@@ -579,6 +582,8 @@ namespace DeviceLibrary
StartMovePosition
+=
RealPulse
;
float
height
=
(
float
)
Math
.
Ceiling
(
1F
*
Math
.
Abs
(
EndMovePosition
-
StartMovePosition
)
/
AxisChangeValue
);
string
buchongStr
=
""
;
string
prefix
=
$
"料盘高度计算({moveInfo.Name})--"
;
LogUtil
.
info
(
$
"{prefix}计算的原始厚度 {height}mm"
);
if
(
Batch_Axis
.
IsInPosition
(
Config
.
Batch_P2
))
{
buchongStr
=
$
"(最后一盘料已补充{Config.LastTrayAddHeight})"
;
...
...
@@ -586,38 +591,95 @@ namespace DeviceLibrary
}
if
(
moveInfo
.
MoveParam
.
PlateW
==
15
)
{
height
-=
2
;
height
-=
w15SubVal
;
LogUtil
.
info
(
$
"{prefix}宽度15料盘,厚度自减{w15SubVal}mm"
);
}
else
if
(
moveInfo
.
MoveParam
.
PlateW
==
13
)
{
height
-=
1
;
height
-=
w13SubVal
;
LogUtil
.
info
(
$
"{prefix}宽度13料盘,厚度自减{w13SubVal}mm"
);
}
//如果检测出<=15,都按照8计算
if
(
height
<
12
)
else
{
LogUtil
.
info
(
$
"{prefix}宽度为{moveInfo.MoveParam.PlateW}mm"
);
}
if
(
height
<
w8MaxVal
)
{
LastHeight
=
8
;
LogUtil
.
info
(
$
"{prefix}计算出的厚度小于{w8MaxVal},认为是8mm料盘"
);
}
else
{
List
<
int
>
heightList
=
new
List
<
int
>
{
8
,
12
,
16
,
24
,
32
,
44
,
56
};
float
minCha
=
float
.
MaxValue
;
foreach
(
int
h
in
heightList
)
if
(
Setting_Init
.
Switch_UseCustHeightList
)
{
float
curCha
=
Math
.
Abs
(
height
-
h
);
if
(
curCha
<
minCha
)
try
{
LastHeight
=
h
;
minCha
=
curCha
;
string
[]
heights
=
Setting_Init
.
Param_CalHeight_HeightList
;
foreach
(
var
item
in
heights
)
{
string
[]
s1
=
item
.
Split
(
'='
);
int
curHeight
;
int
min
,
max
;
curHeight
=
int
.
Parse
(
s1
[
0
]);
string
[]
s2
=
s1
[
1
].
Split
(
'#'
);
min
=
int
.
Parse
(
s2
[
0
]);
max
=
int
.
Parse
(
s2
[
1
]);
if
(
height
>=
min
&&
height
<
max
)
{
LastHeight
=
curHeight
;
break
;
}
}
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
$
"{prefix}使用自定义高度列表异常"
,
e
);
List
<
int
>
heightList
=
new
List
<
int
>
{
8
,
12
,
16
,
24
,
32
,
44
,
56
};
float
minCha
=
float
.
MaxValue
;
foreach
(
int
h
in
heightList
)
{
float
curCha
=
Math
.
Abs
(
height
-
h
);
if
(
curCha
<
minCha
)
{
LastHeight
=
h
;
minCha
=
curCha
;
}
}
// List<int> heightList = new List<int> { 8, 12, 16, 24, 32, 44, 56 };
// foreach (int h in heightList)
// {
// if (height > h)
// {
// LastHeight = h;
// }
// }
}
}
else
{
List
<
int
>
heightList
=
new
List
<
int
>
{
8
,
12
,
16
,
24
,
32
,
44
,
56
};
float
minCha
=
float
.
MaxValue
;
foreach
(
int
h
in
heightList
)
{
float
curCha
=
Math
.
Abs
(
height
-
h
);
if
(
curCha
<
minCha
)
{
LastHeight
=
h
;
minCha
=
curCha
;
}
}
}
}
if
(
LastHeight
<=
8
)
{
LastHeight
=
8
;
}
//string code = CodeManager.ProcessCode(LastCodeList);
string
msg
=
Name
+
$
" 计算盘高:上升前 ["
+
StartMovePosition
+
$
"]实时[ "
+
EndMovePosition
+
$
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
$
"]系数["
+
AxisChangeValue
+
$
"] 计算后"
+
buchongStr
+
"["
+
height
+
"]"
+
$
",归类为【"
+
LastHeight
+
$
"mm】条码【"
+
LastCode
+
"】"
;
string
msg
=
Name
+
prefix
+
"上升前 ["
+
StartMovePosition
+
"]实时[ "
+
EndMovePosition
+
"]差值["
+
(
EndMovePosition
-
StartMovePosition
)
+
"]系数["
+
AxisChangeValue
+
"] 计算后"
+
"["
+
height
+
"],"
+
buchongStr
+
",归类为【"
+
LastHeight
+
"mm】条码【"
+
LastCode
+
"】"
;
LogUtil
.
info
(
msg
);
return
LastHeight
;
}
public
void
StringDoorOpen
(
MoveInfo
moveInfo
)
{
if
(
StringDoor
!=
null
)
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论