Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit de588989
由
LN
编写于
2020-01-14 14:39:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
177a22bb
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
44 行增加
和
97 行删除
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
de58898
...
@@ -123,10 +123,10 @@ PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
...
@@ -123,10 +123,10 @@ PRO,模拟信号2默认高度,AIDI2_DefaultPosition,2960,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,2500,,,,,,,
PRO,模拟信号4默认高度,AIDI4_DefaultPosition,2500,,,,,,,
PRO,模拟信号4默认高度,AIDI4_DefaultPosition,2500,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,模拟信号1的地址,AIDI1_Addr,
7
,,,,,,,
PRO,模拟信号1的地址,AIDI1_Addr,
0
,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,
8
,,,,,,,
PRO,模拟信号2的地址,AIDI2_Addr,
1
,,,,,,,
PRO,模拟信号3的地址,AIDI3_Addr,
5
,,,,,,,
PRO,模拟信号3的地址,AIDI3_Addr,
2
,,,,,,,
PRO,模拟信号4的地址,AIDI4_Addr,
6
,,,,,,,
PRO,模拟信号4的地址,AIDI4_Addr,
3
,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,模拟转换系数,AI_ConvertPosition,55,,,,,,,
PRO,模拟转换系数,AI_ConvertPosition,55,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
...
...
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
de58898
...
@@ -47,6 +47,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -47,6 +47,7 @@ namespace OnlineStore.DeviceLibrary
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
private
System
.
Timers
.
Timer
IoCheckTimer
=
new
System
.
Timers
.
Timer
();
public
AC_SA_BoxBean
(
AC_SA_Config
config
)
public
AC_SA_BoxBean
(
AC_SA_Config
config
)
{
{
// int value= CalHeight(37);
Init
();
Init
();
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
serverConnectTimer
=
new
System
.
Timers
.
Timer
();
serverConnectTimer
.
Interval
=
1000
;
serverConnectTimer
.
Interval
=
1000
;
...
@@ -1563,6 +1564,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1563,6 +1564,8 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
高度传感器处理
#
region
高度传感器处理
// 0、1对应7寸盘,2对应13寸,3对应夹具
public
int
GetSize
()
public
int
GetSize
()
{
{
if
(
Config
.
Default_TrayWidth
>
0
)
if
(
Config
.
Default_TrayWidth
>
0
)
...
@@ -1570,11 +1573,11 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1570,11 +1573,11 @@ namespace OnlineStore.DeviceLibrary
//如果配置了默认宽度,使用默认宽度且不能修改
//如果配置了默认宽度,使用默认宽度且不能修改
return
Config
.
Default_TrayWidth
;
return
Config
.
Default_TrayWidth
;
}
}
if
(
Config
.
AIDI3_Addr
<
=
0
||
Config
.
AIDI4_Addr
<=
0
)
if
(
Config
.
AIDI3_Addr
<
0
)
{
{
return
7
;
return
7
;
}
}
else
if
(
Config
.
AIDI1_Addr
<
=
0
||
Config
.
AIDI2_Addr
<=
0
)
else
if
(
Config
.
AIDI1_Addr
<
0
||
Config
.
AIDI2_Addr
<
0
)
{
{
return
13
;
return
13
;
}
}
...
@@ -1587,9 +1590,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1587,9 +1590,21 @@ namespace OnlineStore.DeviceLibrary
return
7
;
return
7
;
}
}
}
}
public
int
Get7Height
()
public
int
GetHeight
()
{
int
value
=
Get13Height
();
if
(
value
>
0
)
{
return
value
;
}
else
{
return
Get7Height
();
}
}
private
int
Get7Height
()
{
{
if
(
Config
.
AIDI1_Addr
<
=
0
||
Config
.
AIDI2_Addr
<=
0
)
if
(
Config
.
AIDI1_Addr
<
0
||
Config
.
AIDI2_Addr
<
0
)
{
{
return
0
;
return
0
;
}
}
...
@@ -1601,71 +1616,14 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1601,71 +1616,14 @@ namespace OnlineStore.DeviceLibrary
double
ai1Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI1_Addr
),
Config
.
AIDI1_DefaultPosition
);
double
ai1Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI1_Addr
),
Config
.
AIDI1_DefaultPosition
);
double
ai2Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI2_Addr
),
Config
.
AIDI2_DefaultPosition
);
double
ai2Value
=
AIManager
.
ConvertAI
(
AIManager
.
Instance
.
GetAIValue
(
Config
.
AIDevice_IP
,
Config
.
AIDI2_Addr
),
Config
.
AIDI2_DefaultPosition
);
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
)
/
2
,
1
);
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
)
/
2
,
1
);
if
(
Value
>
18
)
return
CalHeight
(
Value
);
{
if
((
Value
%
4
).
Equals
(
0
))
{
result
=
(
int
)
Value
;
}
else
{
result
=
((
int
)
Value
/
4
*
4
)
+
4
;
}
}
else
if
(
Value
>
14
)
{
result
=
16
;
}
else
if
(
Value
>=
10
)
{
result
=
12
;
}
else
if
(
Value
>=
4
)
{
if
(
ai1Value
>=
10
||
ai2Value
>=
10
)
{
result
=
12
;
}
else
{
result
=
8
;
}
}
else
{
result
=
0
;
}
return
result
;
}
}
public
int
GetHeight
()
{
private
int
Get13Height
()
if
(
Config
.
AIDI3_Addr
<=
0
||
Config
.
AIDI4_Addr
<=
0
)
{
return
Get7Height
();
}
else
if
(
Config
.
AIDI1_Addr
<=
0
||
Config
.
AIDI2_Addr
<=
0
)
{
return
Get13Height
();
}
else
{
int
value
=
Get13Height
();
if
(
value
>
0
)
{
return
value
;
}
else
{
return
Get7Height
();
}
}
}
public
int
Get13Height
()
{
{
if
(
Config
.
AIDI3_Addr
<
=
0
||
Config
.
AIDI4_Addr
<=
0
)
if
(
Config
.
AIDI3_Addr
<
0
)
{
{
return
0
;
return
0
;
}
}
...
@@ -1675,42 +1633,31 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1675,42 +1633,31 @@ namespace OnlineStore.DeviceLibrary
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 ai2Value = AIManager.ConvertAI(AIManager.Instance.GetAIValue(Config.AIDevice_IP, Config.AIDI4_Addr), Config.AIDI4_DefaultPosition);
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
)
/
2
,
1
);
// double Value = Math.Round((ai1Value + ai2Value) / 2, 1);
if
(
Value
>
18
)
return
CalHeight
(
ai1Value
);
{
}
if
((
Value
%
4
).
Equals
(
0
))
{
private
int
CalHeight
(
double
Value
)
result
=
(
int
)
Value
;
{
}
int
result
=
0
;
else
if
(
Value
<
5
)
{
result
=
((
int
)
Value
/
4
*
4
)
+
4
;
}
}
else
if
(
Value
>
14
)
{
{
result
=
16
;
result
=
0
;
}
}
else
if
(
Value
>=
10
)
else
if
(
Value
<
8
)
{
{
result
=
12
;
result
=
8
;
}
}
else
if
(
Value
>=
4
)
else
{
{
if
(
ai1Value
>=
10
||
ai2Value
>=
10
)
result
=
(
int
)
Math
.
Floor
(
1F
*
(
Value
)
/
4
)
*
4
;
{
if
(
result
<=
8
)
result
=
12
;
}
else
{
{
result
=
8
;
result
=
8
;
}
}
}
}
else
{
result
=
0
;
}
return
result
;
return
result
;
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论