Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 512107a2
由
几米阳光
编写于
2018-10-29 15:50:03 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
添加高度的计算方式
1 个父辈
58f2028a
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
51 行增加
和
10 行删除
source/ACSingleStore/App.config
source/ACSingleStore/FrmIOStatus.Designer.cs
source/ACSingleStore/FrmIOStatus.cs
source/Common/Setting_Init.cs
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
source/ACSingleStore/App.config
查看文件 @
512107a
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--<
add
key
=
"CodeType"
value
=
"Data Matrix ECC 200"
/>-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<!--二维码参数文件所在路径,文件名与二维码类型名一样-->
<
add
key
=
"CodeParamPath"
value
=
"\StoreConfig\AC\"
/>
<
add
key
=
"CodeParamPath"
value
=
"\StoreConfig\AC\"
/>
<
add
key
=
"AI_ConvertPosition"
value
=
"38"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
512107a
此文件的差异被折叠,
点击展开。
source/ACSingleStore/FrmIOStatus.cs
查看文件 @
512107a
...
@@ -212,6 +212,20 @@ namespace OnlineStore.ACSingleStore
...
@@ -212,6 +212,20 @@ namespace OnlineStore.ACSingleStore
control
.
ShowData
();
control
.
ShowData
();
}
}
}
}
double
ai1Value
=
KNDAIManager
.
GetAIValue
(
boxBean
.
Config
.
AIDevice_IP
,
1
);
double
ai2Value
=
KNDAIManager
.
GetAIValue
(
boxBean
.
Config
.
AIDevice_IP
,
2
);
double
ai3Value
=
KNDAIManager
.
GetAIValue
(
boxBean
.
Config
.
AIDevice_IP
,
3
);
txtAI1
.
Text
=
ai1Value
.
ToString
();
txtAI2
.
Text
=
ai2Value
.
ToString
();
txtAI3
.
Text
=
ai3Value
.
ToString
();
txtAIResult1
.
Text
=
KNDAIManager
.
ConvertAI
(
ai1Value
,
boxBean
.
Config
.
AIDI1_DefaultPosition
).
ToString
();
txtAIResult2
.
Text
=
KNDAIManager
.
ConvertAI
(
ai2Value
,
boxBean
.
Config
.
AIDI2_DefaultPosition
).
ToString
();
txtAIResult3
.
Text
=
KNDAIManager
.
ConvertAI
(
ai3Value
,
boxBean
.
Config
.
AIDI3_DefaultPosition
).
ToString
();
txtHeight
.
Text
=
boxBean
.
GetHeight
().
ToString
();
}
}
private
void
btnReadAllDi_Click
(
object
sender
,
EventArgs
e
)
private
void
btnReadAllDi_Click
(
object
sender
,
EventArgs
e
)
...
...
source/Common/Setting_Init.cs
查看文件 @
512107a
...
@@ -61,6 +61,9 @@ namespace OnlineStore.Common
...
@@ -61,6 +61,9 @@ namespace OnlineStore.Common
/// 配置文件路径 Data Matrix ECC 200.dcm
/// 配置文件路径 Data Matrix ECC 200.dcm
/// </summary>
/// </summary>
public
static
string
CodeParamPath
=
"CodeParamPath"
;
public
static
string
CodeParamPath
=
"CodeParamPath"
;
/// <summary>
/// 高度传感器转换系数
/// </summary>
public
static
string
AI_ConvertPosition
=
"AI_ConvertPosition"
;
}
}
}
}
source/DeviceLibrary/KangNaiDe/KNDAIManager.cs
查看文件 @
512107a
...
@@ -213,12 +213,17 @@ namespace OnlineStore.DeviceLibrary
...
@@ -213,12 +213,17 @@ namespace OnlineStore.DeviceLibrary
}
}
mastMap
.
Clear
();
mastMap
.
Clear
();
}
}
public
static
double
ConvertAI
(
double
aiValue
,
double
defaultValue
)
{
double
xishu
=(
double
)
ConfigAppSettings
.
GetNumValue
(
Setting_Init
.
AI_ConvertPosition
);
double
result
=
Math
.
Round
((
aiValue
-
defaultValue
)/
xishu
,
2
);
return
result
;
}
public
static
double
GetAIValue
(
string
ioiP
,
int
index
)
public
static
double
GetAIValue
(
string
ioiP
,
int
index
)
{
{
double
aiValue
=
GetAIValue
(
ioiP
,
DefualtSlaveID
,
index
);
double
aiValue
=
GetAIValue
(
ioiP
,
DefualtSlaveID
,
index
-
1
);
return
aiValue
;
return
Math
.
Round
(
aiValue
,
2
)
;
}
}
public
static
double
GetAIValue
(
string
ioIP
,
byte
slaveId
,
int
index
)
public
static
double
GetAIValue
(
string
ioIP
,
byte
slaveId
,
int
index
)
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
512107a
...
@@ -118,7 +118,7 @@ PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,15
...
@@ -118,7 +118,7 @@ PRO,硕科步进电机(压紧轴)控制归零速度(原点返回速度),CompressAxis_HomeSpeed,15
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.11,,,,,,,
PRO,模拟量IO模块的IP地址,AIDevice_IP,192.168.200.11,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,
1
,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,
2500
,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,
1
,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,
2500
,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,
1,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,
2500,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
512107a
...
@@ -1328,6 +1328,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1328,6 +1328,7 @@ namespace OnlineStore.DeviceLibrary
message
=
message
+
code
+
spiltStr
;
message
=
message
+
code
+
spiltStr
;
}
}
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
LOW
);
double
height
=
GetHeight
();
onCodeReceived
(
message
);
onCodeReceived
(
message
);
}
}
...
@@ -1349,6 +1350,22 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1349,6 +1350,22 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
高度传感器处理
public
double
GetHeight
()
{
double
result
=
0
;
double
ai1Value
=
KNDAIManager
.
ConvertAI
(
KNDAIManager
.
GetAIValue
(
Config
.
AIDevice_IP
,
1
),
Config
.
AIDI1_DefaultPosition
);
double
ai2Value
=
KNDAIManager
.
ConvertAI
(
KNDAIManager
.
GetAIValue
(
Config
.
AIDevice_IP
,
2
),
Config
.
AIDI2_DefaultPosition
);
double
ai3Value
=
KNDAIManager
.
ConvertAI
(
KNDAIManager
.
GetAIValue
(
Config
.
AIDevice_IP
,
3
),
Config
.
AIDI3_DefaultPosition
);
result
=
Math
.
Round
(
(
ai1Value
+
ai2Value
+
ai3Value
)
/
3
,
1
);
return
result
;
}
#
endregion
#
region
温湿度处理
#
region
温湿度处理
/// <summary>
/// <summary>
/// 湿度标准,超过后需要报警
/// 湿度标准,超过后需要报警
...
...
source/LoadCVSLibrary/storeConfig/config/AC_SA_Config.cs
查看文件 @
512107a
...
@@ -495,18 +495,19 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -495,18 +495,19 @@ namespace OnlineStore.LoadCSVLibrary
/// PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
/// PRO,模拟信号1默认高度,AIDI1_DefaultPosition,1,,,,,,,
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"AIDI1_DefaultPosition"
,
true
)]
[
ConfigProAttribute
(
"AIDI1_DefaultPosition"
,
true
)]
public
string
AIDI1_DefaultPosition
{
get
;
set
;
}
public
double
AIDI1_DefaultPosition
{
get
;
set
;
}
/// <summary>
/// <summary>
/// PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
/// PRO,模拟信号2默认高度,AIDI2_DefaultPosition,1,,,,,,,
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"AIDI2_DefaultPosition"
,
true
)]
[
ConfigProAttribute
(
"AIDI2_DefaultPosition"
,
true
)]
public
string
AIDI2_DefaultPosition
{
get
;
set
;
}
public
double
AIDI2_DefaultPosition
{
get
;
set
;
}
/// <summary>
/// <summary>
/// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
/// PRO,模拟信号3默认高度,AIDI3_DefaultPosition,1,,,,,,,
/// </summary>
/// </summary>
[
ConfigProAttribute
(
"AIDI3_DefaultPosition"
,
true
)]
[
ConfigProAttribute
(
"AIDI3_DefaultPosition"
,
true
)]
public
string
AIDI3_DefaultPosition
{
get
;
set
;
}
public
double
AIDI3_DefaultPosition
{
get
;
set
;
}
//private List<string> TempAddrList = null;
//private List<string> TempAddrList = null;
//public static char TempAddrSpilt = '#';
//public static char TempAddrSpilt = '#';
///// <summary>
///// <summary>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论