Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1454cbb8
由
LN
编写于
2019-12-01 09:29:22 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
8ef2449f
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
256 行增加
和
81 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
source/AssemblyLineClient/FrmFeedingEquip.cs
source/AssemblyLineClient/FrmMoveEquip.Designer.cs
source/AssemblyLineClient/useControl/AxisMoveControl.Designer.cs
source/AssemblyLineClient/useControl/AxisMoveControl.cs
source/Common/Setting_Init.cs
source/Common/util/ConfigAppSettings.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager.cs
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
source/AssemblyLineClient/App.config
查看文件 @
1454cbb
...
@@ -48,6 +48,8 @@
...
@@ -48,6 +48,8 @@
<!--是否打开托盘编码界面-->
<!--是否打开托盘编码界面-->
<
add
key
=
"OpenRFIDWrite"
value
=
"1"
/>
<
add
key
=
"OpenRFIDWrite"
value
=
"1"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<
add
key
=
"DefaultPWD"
value
=
"123456"
/>
<!--当前调试的设备
ID
,分号分割-->
<
add
key
=
"DebugDeviceId"
value
=
"103"
/>
</
appSettings
>
</
appSettings
>
<
log4net
>
<
log4net
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLogFileAppender"
type
=
"log4net.Appender.RollingFileAppender"
>
...
...
source/AssemblyLineClient/FrmFeedingEquip.Designer.cs
查看文件 @
1454cbb
...
@@ -788,7 +788,7 @@
...
@@ -788,7 +788,7 @@
this
.
tabPage2
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage2
.
Location
=
new
System
.
Drawing
.
Point
(
4
,
26
);
this
.
tabPage2
.
Name
=
"tabPage2"
;
this
.
tabPage2
.
Name
=
"tabPage2"
;
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage2
.
Padding
=
new
System
.
Windows
.
Forms
.
Padding
(
3
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
13
65
,
645
);
this
.
tabPage2
.
Size
=
new
System
.
Drawing
.
Size
(
13
19
,
657
);
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
TabIndex
=
1
;
this
.
tabPage2
.
Text
=
" 伺服信息 "
;
this
.
tabPage2
.
Text
=
" 伺服信息 "
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
this
.
tabPage2
.
UseVisualStyleBackColor
=
true
;
...
@@ -804,7 +804,7 @@
...
@@ -804,7 +804,7 @@
this
.
groupBox9
.
Controls
.
Add
(
this
.
txtBP2
);
this
.
groupBox9
.
Controls
.
Add
(
this
.
txtBP2
);
this
.
groupBox9
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
516
);
this
.
groupBox9
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
516
);
this
.
groupBox9
.
Name
=
"groupBox9"
;
this
.
groupBox9
.
Name
=
"groupBox9"
;
this
.
groupBox9
.
Size
=
new
System
.
Drawing
.
Size
(
644
,
150
);
this
.
groupBox9
.
Size
=
new
System
.
Drawing
.
Size
(
836
,
150
);
this
.
groupBox9
.
TabIndex
=
220
;
this
.
groupBox9
.
TabIndex
=
220
;
this
.
groupBox9
.
TabStop
=
false
;
this
.
groupBox9
.
TabStop
=
false
;
this
.
groupBox9
.
Text
=
"上料轴位置配置"
;
this
.
groupBox9
.
Text
=
"上料轴位置配置"
;
...
@@ -916,7 +916,7 @@
...
@@ -916,7 +916,7 @@
//
//
this
.
axisMoveControl1
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
5
);
this
.
axisMoveControl1
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
5
);
this
.
axisMoveControl1
.
Name
=
"axisMoveControl1"
;
this
.
axisMoveControl1
.
Name
=
"axisMoveControl1"
;
this
.
axisMoveControl1
.
Size
=
new
System
.
Drawing
.
Size
(
678
,
353
);
this
.
axisMoveControl1
.
Size
=
new
System
.
Drawing
.
Size
(
858
,
349
);
this
.
axisMoveControl1
.
TabIndex
=
219
;
this
.
axisMoveControl1
.
TabIndex
=
219
;
//
//
// groupBox2
// groupBox2
...
@@ -930,7 +930,7 @@
...
@@ -930,7 +930,7 @@
this
.
groupBox2
.
Controls
.
Add
(
this
.
txtSizePosition
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
txtSizePosition
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
360
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
22
,
360
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
644
,
147
);
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
836
,
147
);
this
.
groupBox2
.
TabIndex
=
218
;
this
.
groupBox2
.
TabIndex
=
218
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"升降轴位置配置"
;
this
.
groupBox2
.
Text
=
"升降轴位置配置"
;
...
...
source/AssemblyLineClient/FrmFeedingEquip.cs
查看文件 @
1454cbb
...
@@ -375,7 +375,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -375,7 +375,7 @@ namespace OnlineStore.AssemblyLine
}
}
private
void
btnTrayLocationCylinder_Click
(
object
sender
,
EventArgs
e
)
private
void
btnTrayLocationCylinder_Click
(
object
sender
,
EventArgs
e
)
{
{
BtnMove
(
btnTrayLocationCylinder
,
"SL升降盘定位气缸前进"
,
"SL升降盘定位气缸后退"
,
IO_Type
.
SL_TrayLocation_
Before
,
IO_Type
.
SL_TrayLocation_After
);
BtnMove
(
btnTrayLocationCylinder
,
"SL升降盘定位气缸前进"
,
"SL升降盘定位气缸后退"
,
IO_Type
.
SL_TrayLocation_
After
,
IO_Type
.
SL_TrayLocation_Before
);
}
}
private
void
btnToroid_TopCylinder_Click
(
object
sender
,
EventArgs
e
)
private
void
btnToroid_TopCylinder_Click
(
object
sender
,
EventArgs
e
)
{
{
...
...
source/AssemblyLineClient/FrmMoveEquip.Designer.cs
查看文件 @
1454cbb
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabControl1
=
new
System
.
Windows
.
Forms
.
TabControl
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage1
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox6
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
lblMoveInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblTrayNum
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblTrayNum
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblInstoreList
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblInstoreList
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
this
.
tabPage2
=
new
System
.
Windows
.
Forms
.
TabPage
();
...
@@ -68,7 +69,6 @@
...
@@ -68,7 +69,6 @@
this
.
txtP2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
txtP2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
lblMoveInfo
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox4
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
this
.
groupBox3
.
SuspendLayout
();
...
@@ -537,6 +537,17 @@
...
@@ -537,6 +537,17 @@
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
TabStop
=
false
;
this
.
groupBox6
.
Text
=
"消息"
;
this
.
groupBox6
.
Text
=
"消息"
;
//
//
// lblMoveInfo
//
this
.
lblMoveInfo
.
AutoSize
=
true
;
this
.
lblMoveInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveInfo
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblMoveInfo
.
Location
=
new
System
.
Drawing
.
Point
(
13
,
29
);
this
.
lblMoveInfo
.
Name
=
"lblMoveInfo"
;
this
.
lblMoveInfo
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
lblMoveInfo
.
TabIndex
=
280
;
this
.
lblMoveInfo
.
Text
=
"运动信息:"
;
//
// lblTrayNum
// lblTrayNum
//
//
this
.
lblTrayNum
.
AutoSize
=
true
;
this
.
lblTrayNum
.
AutoSize
=
true
;
...
@@ -574,7 +585,7 @@
...
@@ -574,7 +585,7 @@
//
//
this
.
axisMoveControl1
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
7
);
this
.
axisMoveControl1
.
Location
=
new
System
.
Drawing
.
Point
(
10
,
7
);
this
.
axisMoveControl1
.
Name
=
"axisMoveControl1"
;
this
.
axisMoveControl1
.
Name
=
"axisMoveControl1"
;
this
.
axisMoveControl1
.
Size
=
new
System
.
Drawing
.
Size
(
678
,
388
);
this
.
axisMoveControl1
.
Size
=
new
System
.
Drawing
.
Size
(
835
,
344
);
this
.
axisMoveControl1
.
TabIndex
=
219
;
this
.
axisMoveControl1
.
TabIndex
=
219
;
//
//
// groupBox2
// groupBox2
...
@@ -588,9 +599,9 @@
...
@@ -588,9 +599,9 @@
this
.
groupBox2
.
Controls
.
Add
(
this
.
label4
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
label4
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnP2
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
btnP2
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
txtP2
);
this
.
groupBox2
.
Controls
.
Add
(
this
.
txtP2
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
19
,
3
96
);
this
.
groupBox2
.
Location
=
new
System
.
Drawing
.
Point
(
19
,
3
69
);
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Name
=
"groupBox2"
;
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
646
,
204
);
this
.
groupBox2
.
Size
=
new
System
.
Drawing
.
Size
(
815
,
204
);
this
.
groupBox2
.
TabIndex
=
218
;
this
.
groupBox2
.
TabIndex
=
218
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
TabStop
=
false
;
this
.
groupBox2
.
Text
=
"升降轴位置配置"
;
this
.
groupBox2
.
Text
=
"升降轴位置配置"
;
...
@@ -749,17 +760,6 @@
...
@@ -749,17 +760,6 @@
this
.
lblName
.
Text
=
"出料流水线"
;
this
.
lblName
.
Text
=
"出料流水线"
;
this
.
lblName
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
this
.
lblName
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
//
// lblMoveInfo
//
this
.
lblMoveInfo
.
AutoSize
=
true
;
this
.
lblMoveInfo
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMoveInfo
.
ImageAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleRight
;
this
.
lblMoveInfo
.
Location
=
new
System
.
Drawing
.
Point
(
13
,
29
);
this
.
lblMoveInfo
.
Name
=
"lblMoveInfo"
;
this
.
lblMoveInfo
.
Size
=
new
System
.
Drawing
.
Size
(
68
,
17
);
this
.
lblMoveInfo
.
TabIndex
=
280
;
this
.
lblMoveInfo
.
Text
=
"运动信息:"
;
//
// FrmMoveEquip
// FrmMoveEquip
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
7F
,
17F
);
...
...
source/AssemblyLineClient/useControl/AxisMoveControl.Designer.cs
查看文件 @
1454cbb
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/useControl/AxisMoveControl.cs
查看文件 @
1454cbb
...
@@ -76,15 +76,25 @@ namespace OnlineStore.AssemblyLine
...
@@ -76,15 +76,25 @@ namespace OnlineStore.AssemblyLine
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
{
{
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【匀速运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
LogUtil
.
info
(
"点击【匀速运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
SpeedMove
(
PortName
,
SlvAddr
,
speed
);
ACServerManager
.
SpeedMove
(
PortName
,
SlvAddr
,
speed
);
}
}
private
void
btnAxisStop_Click
(
object
sender
,
EventArgs
e
)
private
void
btnAxisStop_Click
(
object
sender
,
EventArgs
e
)
{
{
LogUtil
.
info
(
"点击【停止运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 "
);
LogUtil
.
info
(
"点击【停止运动】,【"
+
PortName
+
"_"
+
SlvAddr
+
"】 "
);
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
if
(
btnAddMove
.
BackColor
==
Color
.
Green
)
{
btnAddMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
}
if
(
btnDelMove
.
BackColor
==
Color
.
Green
)
{
btnDelMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
}
btnReadPosition_Click
(
null
,
null
);
}
}
private
void
btnComAlarmClear_Click
(
object
sender
,
EventArgs
e
)
private
void
btnComAlarmClear_Click
(
object
sender
,
EventArgs
e
)
...
@@ -131,11 +141,15 @@ namespace OnlineStore.AssemblyLine
...
@@ -131,11 +141,15 @@ namespace OnlineStore.AssemblyLine
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
Color
color
=
Color
.
Black
;
Color
color
=
Color
.
Black
;
if
(
comboBox1
.
SelectedIndex
.
Equals
(
0
))
if
(
comboBox1
.
SelectedIndex
.
Equals
(
0
))
{
{
btnAddMove
.
Text
=
"点动+(下降)"
;
btnDelMove
.
Text
=
"点动-(上升)"
;
color
=
Color
.
Blue
;
color
=
Color
.
Blue
;
}
}
else
if
(
comboBox1
.
SelectedIndex
.
Equals
(
1
))
else
if
(
comboBox1
.
SelectedIndex
.
Equals
(
1
))
{
{
btnAddMove
.
Text
=
"点动+(上升)"
;
btnDelMove
.
Text
=
"点动-(下降)"
;
color
=
Color
.
Red
;
color
=
Color
.
Red
;
}
}
btnOpenAxis
.
ForeColor
=
color
;
btnOpenAxis
.
ForeColor
=
color
;
...
@@ -148,6 +162,8 @@ namespace OnlineStore.AssemblyLine
...
@@ -148,6 +162,8 @@ namespace OnlineStore.AssemblyLine
btnComAlarmClear
.
ForeColor
=
color
;
btnComAlarmClear
.
ForeColor
=
color
;
btnReadPosition
.
ForeColor
=
color
;
btnReadPosition
.
ForeColor
=
color
;
btnGetAlarm
.
ForeColor
=
color
;
btnGetAlarm
.
ForeColor
=
color
;
btnAddMove
.
ForeColor
=
color
;
btnDelMove
.
ForeColor
=
color
;
this
.
txtAlarmStatus
.
Text
=
""
;
this
.
txtAlarmStatus
.
Text
=
""
;
this
.
txtBusyStatus
.
Text
=
""
;
this
.
txtBusyStatus
.
Text
=
""
;
...
@@ -158,7 +174,59 @@ namespace OnlineStore.AssemblyLine
...
@@ -158,7 +174,59 @@ namespace OnlineStore.AssemblyLine
txtServoStatue
.
Text
=
""
;
txtServoStatue
.
Text
=
""
;
}
}
}
}
private
void
AxisMove
(
int
speed
)
{
LogUtil
.
info
(
"【"
+
PortName
+
"_"
+
SlvAddr
+
"】点动: 速度:"
+
speed
);
ACServerManager
.
SpeedMove
(
PortName
,
SlvAddr
,
speed
);
}
private
void
btnAddMove_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
btnAddMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
return
;
}
btnAddMove
.
BackColor
=
Color
.
Green
;
AxisMove
(
speed
);
}
}
private
void
btnAddMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
{
if
(
btnAddMove
.
BackColor
==
Color
.
Green
)
{
btnAddMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
btnReadPosition_Click
(
null
,
null
);
}
}
private
void
btnDelMove_MouseDown
(
object
sender
,
MouseEventArgs
e
)
{
if
(
btnDelMove
.
BackColor
.
Equals
(
System
.
Drawing
.
SystemColors
.
Control
))
{
int
speed
=
FormUtil
.
GetIntValue
(
txtMiddleSpeed
);
if
(
speed
<=
0
)
{
MessageBox
.
Show
(
"提示"
,
"请先输入正确的速度"
);
return
;
}
btnDelMove
.
BackColor
=
Color
.
Green
;
AxisMove
(-
speed
);
}
}
private
void
btnDelMove_MouseUp
(
object
sender
,
MouseEventArgs
e
)
{
if
(
btnDelMove
.
BackColor
==
Color
.
Green
)
{
btnDelMove
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
ACServerManager
.
SuddenStop
(
PortName
,
SlvAddr
);
btnReadPosition_Click
(
null
,
null
);
}
}
}
}
}
}
source/Common/Setting_Init.cs
查看文件 @
1454cbb
...
@@ -77,5 +77,7 @@ namespace OnlineStore.Common
...
@@ -77,5 +77,7 @@ namespace OnlineStore.Common
public
static
string
OpenRFIDWrite
=
"OpenRFIDWrite"
;
public
static
string
OpenRFIDWrite
=
"OpenRFIDWrite"
;
public
static
string
DefaultPWD
=
"DefaultPWD"
;
public
static
string
DefaultPWD
=
"DefaultPWD"
;
public
static
string
AgvServerIp
=
"AgvServerIp"
;
public
static
string
AgvServerIp
=
"AgvServerIp"
;
public
static
string
DebugDeviceId
=
"DebugDeviceId"
;
}
}
}
}
source/Common/util/ConfigAppSettings.cs
查看文件 @
1454cbb
...
@@ -149,6 +149,11 @@ namespace OnlineStore.Common
...
@@ -149,6 +149,11 @@ namespace OnlineStore.Common
}
}
}
}
public
static
string
GetValue
(
object
debugDeviceId
)
{
throw
new
NotImplementedException
();
}
/// <summary>
/// <summary>
/// 更新配置文件信息
/// 更新配置文件信息
/// </summary>
/// </summary>
...
@@ -170,16 +175,7 @@ namespace OnlineStore.Common
...
@@ -170,16 +175,7 @@ namespace OnlineStore.Common
LogUtil
.
error
(
LOGGER
,
"UpdateConfig保存配置出错:name="
+
name
+
",Xvalue="
+
Xvalue
+
","
+
ex
.
StackTrace
);
LogUtil
.
error
(
LOGGER
,
"UpdateConfig保存配置出错:name="
+
name
+
",Xvalue="
+
Xvalue
+
","
+
ex
.
StackTrace
);
}
}
}
}
public
static
int
GetIntValue
(
object
line_dischargeLine_count
)
{
throw
new
NotImplementedException
();
}
public
static
string
GetValue
(
object
configPath_DischargeLine
)
{
throw
new
NotImplementedException
();
}
///<summary>
///<summary>
///向.config文件的appKey结写入信息AppValue 保存设置
///向.config文件的appKey结写入信息AppValue 保存设置
...
...
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
1454cbb
...
@@ -117,14 +117,41 @@ namespace OnlineStore.DeviceLibrary
...
@@ -117,14 +117,41 @@ namespace OnlineStore.DeviceLibrary
CodeManager
.
LoadConfig
();
CodeManager
.
LoadConfig
();
string
ids
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
DebugDeviceId
);
if
(
IsDebug
)
if
(
IsDebug
)
{
{
List
<
int
>
testDeviceIdList
=
new
List
<
int
>()
{
103
,
104
};
try
ioList
=
new
List
<
string
>();
foreach
(
int
id
in
testDeviceIdList
)
{
{
FeedingEquip
feed
=
FeedingEquipMap
[
103
];
string
[]
testDeviceIdList
=
ids
.
Split
(
','
);
ioList
.
AddRange
(
feed
.
Config
.
IOIPList
);
ioList
=
new
List
<
string
>();
foreach
(
string
str
in
testDeviceIdList
)
{
int
id
=
Convert
.
ToInt32
(
str
);
if
(
FeedingEquipMap
.
ContainsKey
(
id
))
{
FeedingEquip
feed
=
FeedingEquipMap
[
id
];
ioList
.
AddRange
(
feed
.
Config
.
IOIPList
);
}
else
if
(
ProvidingEquipMap
.
ContainsKey
(
id
))
{
ProvidingEquip
feed
=
ProvidingEquipMap
[
id
];
ioList
.
AddRange
(
feed
.
Config
.
IOIPList
);
}
else
if
(
DisLineMap
.
ContainsKey
(
id
))
{
DischargeLine
feed
=
DisLineMap
[
id
];
ioList
.
AddRange
(
feed
.
Config
.
IOIPList
);
}
else
if
(
MoveEquipMap
.
ContainsKey
(
id
))
{
MoveEquip
equip
=
MoveEquipMap
[
id
];
ioList
.
AddRange
(
equip
.
Config
.
IOIPList
);
}
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
Name
+
"加载调试设备出错:"
+
ex
.
ToString
());
}
}
}
}
...
@@ -136,8 +163,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -136,8 +163,8 @@ namespace OnlineStore.DeviceLibrary
{
{
Task
.
Factory
.
StartNew
(
delegate
Task
.
Factory
.
StartNew
(
delegate
{
{
//连接rfip
//连接rfip
RFIDManager
.
ConnectRFIOList
(
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
));
RFIDManager
.
ConnectRFIOList
(
new
List
<
string
>(
DeviceConfig
.
ProRFIpMap
.
Values
));
});
});
}
}
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
addLastDI
(
IO_Type
.
Airpressure_Check
,
IOValue
(
IO_Type
.
Airpressure_Check
));
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager.cs
查看文件 @
1454cbb
...
@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -15,8 +15,8 @@ namespace OnlineStore.DeviceLibrary
public
partial
class
ACServerManager
public
partial
class
ACServerManager
{
{
public
static
bool
IsShowMsg
=
false
;
public
static
bool
IsShowMsg
=
false
;
private
static
int
SleepMSendons
=
2
0
;
private
static
int
SleepMSendons
=
5
0
;
private
static
int
ReviceOutTimeMS
=
1
00
;
private
static
int
ReviceOutTimeMS
=
2
00
;
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
>>();
private
static
string
mapObj
=
""
;
private
static
string
mapObj
=
""
;
...
@@ -177,33 +177,33 @@ namespace OnlineStore.DeviceLibrary
...
@@ -177,33 +177,33 @@ namespace OnlineStore.DeviceLibrary
{
{
LogUtil
.
info
(
"开始初始化伺服【"
+
portName
+
"】【"
+
slvAddr
+
"】"
);
LogUtil
.
info
(
"开始初始化伺服【"
+
portName
+
"】【"
+
slvAddr
+
"】"
);
//写入block
//写入block
int
sleep
=
2
0
;
int
sleep
=
5
0
;
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
string
slvAddrStr
=
string
.
Format
(
strFromat
,
slvAddr
);
//block0=原点返回,正方向
//
//
block0=原点返回,正方向
string
str0
=
slvAddrStr
+
"104800 000408 00000420 00000000 ffff"
;
//
string str0 = slvAddrStr + "104800 000408 00000420 00000000 ffff";
SendStrAndSleep
(
portName
,
str0
,
sleep
);
//
SendStrAndSleep(portName, str0, sleep);
//block1=原点返回,反方向
//
//
block1=原点返回,反方向
string
str1
=
slvAddrStr
+
"104804 000408 04000420 00000000 ffff"
;
//
string str1 = slvAddrStr + "104804 000408 04000420 00000000 ffff";
SendStrAndSleep
(
portName
,
str1
,
sleep
);
//
SendStrAndSleep(portName, str1, sleep);
//block2=绝对位置运动
//
//
block2=绝对位置运动
string
str2
=
slvAddrStr
+
"104808 000408 10000211EC78FFFF ffff"
;
//
string str2 = slvAddrStr + "104808 000408 10000211EC78FFFF ffff";
SendStrAndSleep
(
portName
,
str2
,
sleep
);
//
SendStrAndSleep(portName, str2, sleep);
//block3=相对位置运动
//
//
block3=相对位置运动
string
str3
=
slvAddrStr
+
"10480C 000408 10000111EC78FFFF ffff"
;
//
string str3 = slvAddrStr + "10480C 000408 10000111EC78FFFF ffff";
SendStrAndSleep
(
portName
,
str3
,
sleep
);
//
SendStrAndSleep(portName, str3, sleep);
//block4=正方向匀速运动
//
//
block4=正方向匀速运动
string
str4
=
slvAddrStr
+
"104810 000408 10000311 00000000 ffff"
;
//
string str4 = slvAddrStr + "104810 000408 10000311 00000000 ffff";
SendStrAndSleep
(
portName
,
str4
,
sleep
);
//
SendStrAndSleep(portName, str4, sleep);
//block5=反方向匀速运动
//
//
block5=反方向匀速运动
string
str5
=
slvAddrStr
+
"104814 000408 14000311 00000000 ffff"
;
//
string str5 = slvAddrStr + "104814 000408 14000311 00000000 ffff";
SendStrAndSleep
(
portName
,
str5
,
sleep
);
//
SendStrAndSleep(portName, str5, sleep);
//block6=减速停止
//
//
block6=减速停止
string
str6
=
slvAddrStr
+
"104818 000408 00000500 00000000 ffff"
;
//
string str6 = slvAddrStr + "104818 000408 00000500 00000000 ffff";
SendStrAndSleep
(
portName
,
str6
,
sleep
);
//
SendStrAndSleep(portName, str6, sleep);
//block7=紧急停止
//
//
block7=紧急停止
string
str7
=
slvAddrStr
+
"10481c 000408 00000510 00000000 ffff"
;
//
string str7 = slvAddrStr + "10481c 000408 00000510 00000000 ffff";
SendStrAndSleep
(
portName
,
str7
,
sleep
);
//
SendStrAndSleep(portName, str7, sleep);
//0106460001009D12
//0106460001009D12
//速度 V1 =100
//速度 V1 =100
...
@@ -362,16 +362,28 @@ namespace OnlineStore.DeviceLibrary
...
@@ -362,16 +362,28 @@ namespace OnlineStore.DeviceLibrary
}
}
public
static
void
SetSpeed
(
string
portName
,
int
slvAddr
,
int
speed
)
public
static
void
SetSpeed
(
string
portName
,
int
slvAddr
,
int
speed
)
{
{
int
preSpeed
=
GetAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
);
int
preSpeed
=
GetAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
);
if
((
preSpeed
.
Equals
(-
1
))
||
(!
preSpeed
.
Equals
(
Math
.
Abs
(
speed
))))
if
((
preSpeed
.
Equals
(-
1
))
||
(!
preSpeed
.
Equals
(
Math
.
Abs
(
speed
))))
{
{
string
v1
=
slvAddr
+
"064601 "
+
ACServerManager
.
SpeedToStr
(
speed
,
4
)
+
" ffff"
;
string
v1
=
slvAddr
+
"064601 "
+
ACServerManager
.
SpeedToStr
(
speed
,
4
)
+
" ffff"
;
LogUtil
.
debug
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】更新速度为【"
+
speed
+
"】,发送数据【"
+
v1
+
"】"
);
LogUtil
.
debug
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】更新速度为【"
+
speed
+
"】,发送数据【"
+
v1
+
"】"
);
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
Math
.
Abs
(
speed
));
Thread
.
Sleep
(
SleepMSendons
);
Thread
.
Sleep
(
SleepMSendons
);
}
for
(
int
i
=
1
;
i
<=
3
;
i
++)
{
bool
result
=
SendStrAndSleep
(
portName
,
v1
,
SleepMSendons
);
if
(
result
)
{
break
;
}
else
{
LogUtil
.
error
(
"轴【"
+
portName
+
"_"
+
slvAddr
+
"】更新速度为【"
+
speed
+
"】,发送数据【"
+
v1
+
"】,第【"
+
i
+
"】次失败"
);
Thread
.
Sleep
(
SleepMSendons
);
}
}
UpdateAddrValue
(
portName
,
slvAddr
,
ACCMDManager
.
Speed_Addr
,
Math
.
Abs
(
speed
));
Thread
.
Sleep
(
SleepMSendons
);
}
}
}
public
static
void
SpeedMove
(
string
portName
,
int
slvAddr
,
int
speed
)
public
static
void
SpeedMove
(
string
portName
,
int
slvAddr
,
int
speed
)
{
{
...
...
source/DeviceLibrary/deviceLibrary/PanasonicServo/ACServerManager_Partial.cs
查看文件 @
1454cbb
...
@@ -27,16 +27,18 @@ namespace OnlineStore.DeviceLibrary
...
@@ -27,16 +27,18 @@ namespace OnlineStore.DeviceLibrary
}
}
return
null
;
return
null
;
}
}
public
static
void
SendStrAndSleep
(
string
portName
,
string
str
,
int
sleepS
)
public
static
bool
SendStrAndSleep
(
string
portName
,
string
str
,
int
sleepS
)
{
{
byte
[]
data
=
AcSerialBean
.
StringToByte
(
str
);
byte
[]
data
=
AcSerialBean
.
StringToByte
(
str
);
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
1
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
[
data
.
Length
-
2
]
=
0x00
;
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
data
=
ACCMDManager
.
buildCheckData
(
data
,
data
.
Length
-
2
);
SendData
(
portName
,
data
);
bool
result
=
SendData
(
portName
,
data
);
System
.
Threading
.
Thread
.
Sleep
(
sleepS
);
System
.
Threading
.
Thread
.
Sleep
(
sleepS
);
}
return
result
;
}
public
static
void
SaveData
(
string
portName
,
byte
slvAddr
,
string
regAddr
,
int
value
)
public
static
void
SaveData
(
string
portName
,
byte
slvAddr
,
string
regAddr
,
int
value
)
{
{
...
@@ -88,13 +90,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -88,13 +90,20 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
"串口"
+
portName
+
" 收到数据:"
+
strSend
+
""
);
LogUtil
.
info
(
"串口"
+
portName
+
" 收到数据:"
+
strSend
+
""
);
}
}
}
}
public
static
void
SendData
(
string
portName
,
byte
[]
data
)
public
static
bool
SendData
(
string
portName
,
byte
[]
data
)
{
{
if
(
data
==
null
)
if
(
data
==
null
)
{
{
return
;
return
false
;
}
}
byte
[]
returnData
=
SendCommand
(
portName
,
data
,
ReviceOutTimeMS
,
8
);
int
timeOut
=
ReviceOutTimeMS
;
if
(
data
[
1
].
Equals
((
byte
)
10
))
{
timeOut
=
1000
;
}
bool
result
=
false
;
byte
[]
returnData
=
SendCommand
(
portName
,
data
,
timeOut
,
8
,
out
result
);
if
(
returnData
!=
null
)
if
(
returnData
!=
null
)
{
{
string
strSend
=
""
;
string
strSend
=
""
;
...
@@ -107,6 +116,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -107,6 +116,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil
.
info
(
"串口"
+
portName
+
" 收到数据:"
+
strSend
+
""
);
LogUtil
.
info
(
"串口"
+
portName
+
" 收到数据:"
+
strSend
+
""
);
}
}
}
}
return
result
;
}
}
/// <summary>
/// <summary>
/// 发送数据并获取返回值
/// 发送数据并获取返回值
...
@@ -163,7 +173,65 @@ namespace OnlineStore.DeviceLibrary
...
@@ -163,7 +173,65 @@ namespace OnlineStore.DeviceLibrary
}
}
return
returnData
;
return
returnData
;
}
}
/// <summary>
/// 发送数据并获取返回值
/// </summary>
/// <param name="data">发送的数据</param>
/// <param name="outTime">超时时间</param>
/// <param name="result">返回结果,是否发送成功</param>
/// <returns>返回值的长度</returns>
public
static
byte
[]
SendCommand
(
string
portName
,
byte
[]
data
,
int
outTime
,
int
reviceLength
,
out
bool
result
)
{
if
(
outTime
<
100
)
{
outTime
=
100
;
}
byte
[]
returnData
=
null
;
result
=
false
;
try
{
if
(
data
==
null
)
{
return
returnData
;
}
string
strSend
=
""
;
for
(
int
i
=
0
;
i
<
data
.
Length
;
i
++)
{
strSend
+=
string
.
Format
(
"{0:X2} "
,
data
[
i
]);
}
if
(
strSend
.
Equals
(
""
))
{
return
returnData
;
}
if
(
IsShowMsg
)
{
LogUtil
.
info
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
""
);
}
AcSerialBean
bean
=
GetSerialBean
(
portName
);
if
(
bean
==
null
)
{
LogUtil
.
debug
(
"ACServerManager SendCommand 试图向未打开串口【"
+
portName
+
"】写入数据:"
+
strSend
+
"。"
);
}
else
{
int
ret
=
bean
.
SendCommand
(
data
,
ref
returnData
,
outTime
,
reviceLength
);
if
(!
ret
.
Equals
(
reviceLength
))
{
LogUtil
.
error
(
"串口"
+
portName
+
" 写入数据:"
+
strSend
+
",预计返回字节数【"
+
reviceLength
+
"】实际返回【"
+
ret
+
"】"
);
}
else
{
result
=
true
;
}
System
.
Threading
.
Thread
.
Sleep
(
2
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
info
(
ex
.
ToString
());
}
return
returnData
;
}
public
static
void
WriteData
(
string
portName
,
int
slvAddr
,
string
addr
,
string
data
,
byte
cmd
,
int
length
)
public
static
void
WriteData
(
string
portName
,
int
slvAddr
,
string
addr
,
string
data
,
byte
cmd
,
int
length
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论