Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9a2c2f79
由
LN
编写于
2020-08-03 23:08:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
宽度改为13,15,7
1 个父辈
fbd26364
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
55 行增加
和
25 行删除
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/IO/AIOBOX/AIOBOXManager.cs
查看文件 @
9a2c2f7
...
@@ -309,11 +309,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -309,11 +309,18 @@ namespace OnlineStore.DeviceLibrary
public
override
void
CloseAllConnection
()
public
override
void
CloseAllConnection
()
{
{
foreach
(
AIOBOX
aio
in
AIOMap
.
Values
)
try
{
foreach
(
AIOBOX
aio
in
AIOMap
.
Values
)
{
aio
.
Close
();
}
AIOMap
.
Clear
();
}
catch
(
Exception
ex
)
{
{
aio
.
Close
(
);
LogUtil
.
error
(
"CloseAllConnection 出错:"
+
ex
.
ToString
()
);
}
}
AIOMap
.
Clear
();
}
}
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
public
override
void
WriteSingleDO
(
string
ioIp
,
byte
slaveId
,
ushort
StartAddress
,
IO_VALUE
onOff
)
{
{
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
9a2c2f7
...
@@ -1591,7 +1591,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1591,7 +1591,7 @@ namespace OnlineStore.DeviceLibrary
#
region
高度传感器处理
#
region
高度传感器处理
private
int
smallWidth
=
7
;
private
int
smallWidth
=
7
;
// 0、1对应7寸盘,2对应13寸,3对应
夹具
// 0、1对应7寸盘,2对应13寸,3对应
15
public
int
GetSize
()
public
int
GetSize
()
{
{
if
(
Config
.
Default_TrayWidth
>
0
)
if
(
Config
.
Default_TrayWidth
>
0
)
...
@@ -1599,21 +1599,32 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1599,21 +1599,32 @@ namespace OnlineStore.DeviceLibrary
//如果配置了默认宽度,使用默认宽度且不能修改
//如果配置了默认宽度,使用默认宽度且不能修改
return
Config
.
Default_TrayWidth
;
return
Config
.
Default_TrayWidth
;
}
}
if
(
Config
.
AIDI3_Addr
<
0
)
if
(
Config
.
AIDI3_Addr
<
0
||
Config
.
AIDI4_Addr
<=
0
)
{
{
return
smallWidth
;
return
smallWidth
;
}
}
else
if
(
Config
.
AIDI1_Addr
<
0
||
Config
.
AIDI2_Addr
<
0
)
else
if
(
Config
.
AIDI1_Addr
<
0
||
Config
.
AIDI2_Addr
<
0
)
{
{
return
Config
.
Big_TrayWidth
;
if
(
Get15Height
()
>
0
)
{
return
15
;
}
else
if
(
Get13Height
()
>
0
)
{
return
13
;
}
}
if
(
Get15Height
()
>
0
)
{
return
15
;
}
else
if
(
Get13Height
()
>
0
)
{
return
13
;
}
}
else
else
{
{
if
(
GetBigHeight
()
>
0
)
return
7
;
{
return
Config
.
Big_TrayWidth
;
}
return
smallWidth
;
}
}
}
}
public
int
GetHeight
()
public
int
GetHeight
()
...
@@ -1622,21 +1633,19 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1622,21 +1633,19 @@ namespace OnlineStore.DeviceLibrary
{
{
return
GetSmallHeight
();
return
GetSmallHeight
();
}
}
else
if
(
Config
.
Default_TrayWidth
.
Equals
(
Config
.
Big_TrayWidth
))
{
return
GetBigHeight
();
}
else
else
{
{
int
value
=
GetBig
Height
();
int
h15
=
Get15
Height
();
if
(
value
>
0
)
if
(
h15
>
0
)
{
{
return
value
;
return
h15
;
}
}
else
int
h13
=
Get13Height
();
if
(
h13
>
0
)
{
{
return
GetSmallHeight
()
;
return
h13
;
}
}
return
GetSmallHeight
();
}
}
}
}
private
int
GetSmallHeight
()
private
int
GetSmallHeight
()
...
@@ -1658,20 +1667,34 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1658,20 +1667,34 @@ namespace OnlineStore.DeviceLibrary
}
}
private
int
Get
Big
Height
()
private
int
Get
13
Height
()
{
{
if
(
Config
.
AIDI3_Addr
<
0
||
Config
.
AIDI4_Addr
<
0
)
if
(
Config
.
AIDI3_Addr
<
0
)
{
{
return
0
;
return
0
;
}
}
int
result
=
0
;
int
result
=
0
;
if
(
Config
.
Default_TrayWidth
.
Equals
(
Config
.
Big_TrayWidth
).
Equals
(
false
)
&&
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
{
return
result
;
return
result
;
}
}
double
ai1Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI3_Addr
),
Config
.
AIDI3_DefaultPosition
);
double
ai1Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI3_Addr
),
Config
.
AIDI3_DefaultPosition
);
double
ai2Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI4_Addr
),
Config
.
AIDI4_DefaultPosition
);
double
Value
=
Math
.
Round
((
ai1Value
)
/
1
,
1
);
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
)
/
2
,
1
);
return
CalHeight
(
Value
);
}
private
int
Get15Height
()
{
if
(
Config
.
AIDI4_Addr
<
0
)
{
return
0
;
}
int
result
=
0
;
if
(
IOManager
.
IOValue
(
IO_Type
.
TrayCheck_Door
).
Equals
(
IO_VALUE
.
LOW
))
{
return
result
;
}
double
ai1Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI4_Addr
),
Config
.
AIDI4_DefaultPosition
);
double
Value
=
Math
.
Round
((
ai1Value
)
/
1
,
1
);
return
CalHeight
(
Value
);
return
CalHeight
(
Value
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论