Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
ACSingleStore
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2ab07c86
由
几米阳光
编写于
2018-10-30 10:22:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
回原点反向都是负方向,料格都是7*8的
1 个父辈
542e90dd
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
64 行增加
和
31 行删除
source/ACServoDriveTest/FrmACTest.cs
source/ACSingleStore/App.config
source/ACSingleStore/FrmIOStatus.Designer.cs
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
source/ACServoDriveTest/FrmACTest.cs
查看文件 @
2ab07c8
...
@@ -131,6 +131,7 @@ namespace ACServoDriveTest
...
@@ -131,6 +131,7 @@ namespace ACServoDriveTest
}
}
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
private
void
Form1_Load
(
object
sender
,
EventArgs
e
)
{
{
ACServerManager
.
IsShowMsg
=
true
;
LogUtil
.
logBox
=
this
.
richTextBox1
;
LogUtil
.
logBox
=
this
.
richTextBox1
;
//ACServerManager.richeBox = this.richTextBox1;
//ACServerManager.richeBox = this.richTextBox1;
formStatus
(
false
);
formStatus
(
false
);
...
...
source/ACSingleStore/App.config
查看文件 @
2ab07c8
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_Position_Config"
value
=
"\StoreConfig\AC\linePositions.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_ConfigPath"
value
=
"\StoreConfig\AC\StoreConfig.csv"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_Type"
value
=
"RC_AC_SA"
/>
<
add
key
=
"Store_CID"
value
=
"
bj
ac1"
/>
<
add
key
=
"Store_CID"
value
=
"
ld
ac1"
/>
<!--
end
one
store
config
-->
<!--
end
one
store
config
-->
<!--摄像机名称列表配置,用
#分割-->
<!--摄像机名称列表配置,用
#分割-->
...
...
source/ACSingleStore/FrmIOStatus.Designer.cs
查看文件 @
2ab07c8
...
@@ -485,10 +485,10 @@
...
@@ -485,10 +485,10 @@
//
//
this
.
txtHeight
.
Enabled
=
false
;
this
.
txtHeight
.
Enabled
=
false
;
this
.
txtHeight
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtHeight
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
txtHeight
.
Location
=
new
System
.
Drawing
.
Point
(
84
,
116
);
this
.
txtHeight
.
Location
=
new
System
.
Drawing
.
Point
(
113
,
116
);
this
.
txtHeight
.
MaxLength
=
10
;
this
.
txtHeight
.
MaxLength
=
10
;
this
.
txtHeight
.
Name
=
"txtHeight"
;
this
.
txtHeight
.
Name
=
"txtHeight"
;
this
.
txtHeight
.
Size
=
new
System
.
Drawing
.
Size
(
2
40
,
23
);
this
.
txtHeight
.
Size
=
new
System
.
Drawing
.
Size
(
2
11
,
23
);
this
.
txtHeight
.
TabIndex
=
254
;
this
.
txtHeight
.
TabIndex
=
254
;
this
.
txtHeight
.
Text
=
"0"
;
this
.
txtHeight
.
Text
=
"0"
;
//
//
...
@@ -499,9 +499,9 @@
...
@@ -499,9 +499,9 @@
this
.
label9
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label9
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label9
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
119
);
this
.
label9
.
Location
=
new
System
.
Drawing
.
Point
(
15
,
119
);
this
.
label9
.
Name
=
"label9"
;
this
.
label9
.
Name
=
"label9"
;
this
.
label9
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
label9
.
Size
=
new
System
.
Drawing
.
Size
(
92
,
17
);
this
.
label9
.
TabIndex
=
253
;
this
.
label9
.
TabIndex
=
253
;
this
.
label9
.
Text
=
"实时高度:"
;
this
.
label9
.
Text
=
"实时
料盘
高度:"
;
this
.
label9
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
label9
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
//
//
// label8
// label8
...
...
source/DeviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
2ab07c8
...
@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -13,7 +13,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
/// </summary>
public
partial
class
ACServerManager
public
partial
class
ACServerManager
{
{
p
rivate
static
bool
IsShowMsg
=
false
;
p
ublic
static
bool
IsShowMsg
=
false
;
private
static
int
SleepMSendons
=
100
;
private
static
int
SleepMSendons
=
100
;
private
static
Dictionary
<
string
,
Dictionary
<
string
,
int
>>
ComAddrValue
=
new
Dictionary
<
string
,
Dictionary
<
string
,
int
>>();
private
static
Dictionary
<
string
,
Dictionary
<
string
,
int
>>
ComAddrValue
=
new
Dictionary
<
string
,
Dictionary
<
string
,
int
>>();
...
@@ -298,21 +298,21 @@ namespace OnlineStore.DeviceLibrary
...
@@ -298,21 +298,21 @@ namespace OnlineStore.DeviceLibrary
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_HomeMove1, 2);
//byte[] data = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_WriteRegisters, ACCMDManager.BlockNo, ACCMDManager.Block_HomeMove1, 2);
//SendData(portName, data);
//SendData(portName, data);
//旋转轴回正方向,其他轴回负方向
//旋转轴回正方向,其他轴回负方向
if
(
portName
.
Equals
(
ACStoreManager
.
store
.
Config
.
Middle_Axis
.
DeviceName
))
//
if (portName.Equals(ACStoreManager.store.Config.Middle_Axis.DeviceName))
{
//
{
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove0
);
//
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil
.
info
(
"旋转轴原点返回方向:正方向"
);
//
LogUtil.info("旋转轴原点返回方向:正方向");
}
//
}
else
if
(
portName
.
Equals
(
ACStoreManager
.
store
.
Config
.
InOut_Axis
.
DeviceName
))
//
else if (portName.Equals(ACStoreManager.store.Config.InOut_Axis.DeviceName))
{
//
{
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove0
);
//
UpdateBlock(portName, slvAddr, ACCMDManager.Block_HomeMove0);
LogUtil
.
info
(
"进出轴原点返回方向:正方向"
);
//
LogUtil.info("进出轴原点返回方向:正方向");
}
//
}
else
//
else
{
//
{
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove1
);
UpdateBlock
(
portName
,
slvAddr
,
ACCMDManager
.
Block_HomeMove1
);
LogUtil
.
info
(
"
升降轴原点返回方向
:反方向"
);
LogUtil
.
info
(
"
回原点
:反方向"
);
}
//
}
Thread
.
Sleep
(
SleepMSendons
);
Thread
.
Sleep
(
SleepMSendons
);
OpenAndCloseSTB
(
portName
,
slvAddr
);
OpenAndCloseSTB
(
portName
,
slvAddr
);
}
}
...
...
source/DeviceLibrary/StoreConfig/AC/StoreConfig.csv
查看文件 @
2ab07c8
...
@@ -119,6 +119,6 @@ PRO,硕科步进电机轴地址(压紧轴),CompressAxis_Slv,1,,,,,,,
...
@@ -119,6 +119,6 @@ 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,2500,,,,,,,
PRO,模拟信号1默认高度,AIDI1_DefaultPosition,2500,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,25
0
0,,,,,,,
PRO,模拟信号2默认高度,AIDI2_DefaultPosition,25
1
0,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,25
0
0,,,,,,,
PRO,模拟信号3默认高度,AIDI3_DefaultPosition,25
2
0,,,,,,,
,,,,,,,,, ,
,,,,,,,,, ,
source/DeviceLibrary/StoreConfig/AC/linePositions.csv
查看文件 @
2ab07c8
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/acSingleStore/AC_SA_BoxBean.cs
查看文件 @
2ab07c8
...
@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -418,7 +418,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,压紧轴回原点,关闭舱门"
);
LogUtil
.
info
(
LOGGER
,
StoreName
+
"到待机状态,压紧轴回原点,关闭舱门"
);
if
(
IsHasCompress_Axis
)
if
(
IsHasCompress_Axis
)
{
{
ShuoKeControls
.
HomeMove
(
Config
.
CompressAxis_Slv
,
1
);
ShuoKeControls
.
HomeMove
(
Config
.
CompressAxis_Slv
,
0
);
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitShuoKe
(
Config
.
CompressAxis_Slv
,
1
,
true
));
StoreMove
.
WaitList
.
Add
(
WaitResultInfo
.
WaitShuoKe
(
Config
.
CompressAxis_Slv
,
1
,
true
));
}
}
//关闭舱门
//关闭舱门
...
@@ -950,12 +950,12 @@ namespace OnlineStore.DeviceLibrary
...
@@ -950,12 +950,12 @@ namespace OnlineStore.DeviceLibrary
{
{
TimeSpan
span
=
DateTime
.
Now
-
StartWaitScanTime
;
TimeSpan
span
=
DateTime
.
Now
-
StartWaitScanTime
;
if
(
span
.
TotalSeconds
>
0.5
)
if
(
span
.
TotalSeconds
>
0.5
)
{
{
isWaitScan
=
false
;
isWaitScan
=
false
;
IsScanCode
=
true
;
IsScanCode
=
true
;
LogUtil
.
info
(
StoreName
+
"检测到料盘信号且等待0.5秒,开始扫码"
);
LogUtil
.
info
(
StoreName
+
"检测到料盘信号且等待0.5秒,开始扫码"
);
//BeginScannering();
//BeginScannering();
GetCameraCode
();
GetCameraCode
();
}
}
}
}
else
else
...
@@ -1316,19 +1316,24 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1316,19 +1316,24 @@ namespace OnlineStore.DeviceLibrary
private
string
spiltStr
=
"##"
;
private
string
spiltStr
=
"##"
;
private
void
scanTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
private
void
scanTimer_Elapsed
(
object
sender
,
System
.
Timers
.
ElapsedEventArgs
e
)
{
{
int
height
=
GetHeight
();
DateTime
date
=
DateTime
.
Now
;
DateTime
date
=
DateTime
.
Now
;
scanTimer
.
Enabled
=
false
;
scanTimer
.
Enabled
=
false
;
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
KNDIOMove
(
IO_Type
.
CameraLight_Power
,
IO_VALUE
.
HIGH
);
string
message
=
""
;
string
message
=
""
;
List
<
string
>
codeList
=
HDevelopExport
.
CameraScan
();
List
<
string
>
codeList
=
HDevelopExport
.
CameraScan
();
//= 1 + 123.4x100.5 - 7x12 = CODE
foreach
(
string
str
in
codeList
)
foreach
(
string
str
in
codeList
)
{
{
string
code
=
HDevelopExport
.
SubStrCode
(
str
);
string
code
=
HDevelopExport
.
SubStrCode
(
str
);
code
=
"=7X"
+
height
+
" ="
+
code
;
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
);
}
}
...
@@ -1351,15 +1356,42 @@ namespace OnlineStore.DeviceLibrary
...
@@ -1351,15 +1356,42 @@ namespace OnlineStore.DeviceLibrary
#
endregion
#
endregion
#
region
高度传感器处理
#
region
高度传感器处理
public
double
GetHeight
()
public
int
GetHeight
()
{
{
double
result
=
0
;
int
result
=
0
;
double
ai1Value
=
KNDAIManager
.
ConvertAI
(
KNDAIManager
.
GetAIValue
(
Config
.
AIDevice_IP
,
1
),
Config
.
AIDI1_DefaultPosition
);
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
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
);
double
ai3Value
=
KNDAIManager
.
ConvertAI
(
KNDAIManager
.
GetAIValue
(
Config
.
AIDevice_IP
,
3
),
Config
.
AIDI3_DefaultPosition
);
result
=
Math
.
Round
(
(
ai1Value
+
ai2Value
+
ai3Value
)
/
3
,
1
);
double
Value
=
Math
.
Round
((
ai1Value
+
ai2Value
+
ai3Value
)
/
3
,
1
);
//int radValue =(int) ( Value / 4);
//double mValue = (Value % 4);
//if (mValue > 1)
//{
// result = radValue * 4 + 4;
//}
//else
//{
// result = radValue * 4;
//}
if
(
Value
>
14
)
{
result
=
16
;
}
else
if
(
Value
>=
10
)
{
result
=
12
;
}
else
if
(
Value
>=
4
)
{
result
=
8
;
}
else
{
result
=
0
;
}
return
result
;
return
result
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论