Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
RC1250-AssemblyLine
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit db959699
由
LN
编写于
2019-10-09 17:25:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加Io配置
1 个父辈
27d4a2b5
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
324 行增加
和
267 行删除
source/AssemblyLineClient/App.config
source/AssemblyLineClient/AssemblyLineClient.csproj
source/AssemblyLineClient/FrmDischargeLine.Designer.cs
source/AssemblyLineClient/FrmDischargeLine.cs
source/AssemblyLineClient/FrmDischargeLine.resx
source/AssemblyLineClient/FrmIOStatus.Designer.cs
source/AssemblyLineClient/FrmIOStatus.cs
source/AssemblyLineClient/FrmIOStatus.resx
source/AssemblyLineClient/FrmLineStore.cs
source/AssemblyLineClient/FrmProvidingEquip.Designer.cs
source/AssemblyLineClient/FrmProvidingEquip.cs
source/Common/Setting_Init.cs
source/Common/util/ConfigAppSettings.cs
source/DeviceLibrary/DeviceLibrary.csproj
source/DeviceLibrary/LineConfig/Config_DischargeLine_1.csv
source/DeviceLibrary/LineConfig/Config_DischargeLine_2.csv
source/DeviceLibrary/LineConfig/Config_Line.csv
source/DeviceLibrary/assemblyLine/AssemblyLineManager.cs
source/DeviceLibrary/assemblyLine/DischargeLine.cs
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
source/DeviceLibrary/assemblyLine/LineBean.cs
source/LoadCVSLibrary/LoadCSVLibrary.csproj
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
source/LoadCVSLibrary/storeConfig/config/DischargeLine_Config.cs
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
source/LoadCVSLibrary/storeConfig/config/Line_Config.cs
source/AssemblyLineClient/App.config
查看文件 @
db95969
...
@@ -13,11 +13,13 @@
...
@@ -13,11 +13,13 @@
<
add
key
=
"Line_moveEquip_count"
value
=
"18"
/>
<
add
key
=
"Line_moveEquip_count"
value
=
"18"
/>
<
add
key
=
"Line_feedingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_feedingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_providingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_providingEquip_count"
value
=
"4"
/>
<
add
key
=
"Line_dischargeLine_count"
value
=
"2"
/>
<!--
start
one
store
config
-->
<!--
start
one
store
config
-->
<
add
key
=
"ConfigPath_Line"
value
=
"\LineConfig\Config_Line.csv"
/>
<
add
key
=
"ConfigPath_Line"
value
=
"\LineConfig\Config_Line.csv"
/>
<
add
key
=
"ConfigPath_MoveEquip"
value
=
"\LineConfig\MoveEquip\Config_MoveEquip.csv"
/>
<
add
key
=
"ConfigPath_MoveEquip"
value
=
"\LineConfig\MoveEquip\Config_MoveEquip.csv"
/>
<
add
key
=
"ConfigPath_FeedingEquip"
value
=
"\LineConfig\Config_FeedingEquip.csv"
/>
<
add
key
=
"ConfigPath_FeedingEquip"
value
=
"\LineConfig\Config_FeedingEquip.csv"
/>
<
add
key
=
"ConfigPath_ProvidingEquip"
value
=
"\LineConfig\Config_ProvidingEquip.csv"
/>
<
add
key
=
"ConfigPath_ProvidingEquip"
value
=
"\LineConfig\Config_ProvidingEquip.csv"
/>
<
add
key
=
"ConfigPath_DischargeLine"
value
=
"\LineConfig\Config_DischargeLine.csv"
/>
<
add
key
=
"Line_Type"
value
=
"RC_LINE"
/>
<
add
key
=
"Line_Type"
value
=
"RC_LINE"
/>
<
add
key
=
"Line_CID"
value
=
"rc1246"
/>
<
add
key
=
"Line_CID"
value
=
"rc1246"
/>
<!--
end
one
store
config
-->
<!--
end
one
store
config
-->
...
...
source/AssemblyLineClient/AssemblyLineClient.csproj
查看文件 @
db95969
...
@@ -84,6 +84,12 @@
...
@@ -84,6 +84,12 @@
<Compile Include="FrmBase.Designer.cs">
<Compile Include="FrmBase.Designer.cs">
<DependentUpon>FrmBase.cs</DependentUpon>
<DependentUpon>FrmBase.cs</DependentUpon>
</Compile>
</Compile>
<Compile Include="FrmDischargeLine.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FrmDischargeLine.Designer.cs">
<DependentUpon>FrmDischargeLine.cs</DependentUpon>
</Compile>
<Compile Include="FrmProvidingEquip.cs">
<Compile Include="FrmProvidingEquip.cs">
<SubType>Form</SubType>
<SubType>Form</SubType>
</Compile>
</Compile>
...
@@ -132,6 +138,9 @@
...
@@ -132,6 +138,9 @@
<EmbeddedResource Include="FrmBase.resx">
<EmbeddedResource Include="FrmBase.resx">
<DependentUpon>FrmBase.cs</DependentUpon>
<DependentUpon>FrmBase.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource Include="FrmDischargeLine.resx">
<DependentUpon>FrmDischargeLine.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="FrmProvidingEquip.resx">
<EmbeddedResource Include="FrmProvidingEquip.resx">
<DependentUpon>FrmProvidingEquip.cs</DependentUpon>
<DependentUpon>FrmProvidingEquip.cs</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
...
...
source/AssemblyLineClient/FrmDischargeLine.Designer.cs
0 → 100644
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmDischargeLine.cs
0 → 100644
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmDischargeLine.resx
0 → 100644
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmIOStatus.Designer.cs
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmIOStatus.cs
查看文件 @
db95969
...
@@ -38,7 +38,14 @@ namespace OnlineStore.AssemblyLine
...
@@ -38,7 +38,14 @@ namespace OnlineStore.AssemblyLine
this
.
tableLayoutPanel1
.
RowStyles
.
Clear
();
this
.
tableLayoutPanel1
.
RowStyles
.
Clear
();
this
.
tableLayoutPanel1
.
RowCount
=
count
;
this
.
tableLayoutPanel1
.
RowCount
=
count
;
this
.
tableLayoutPanel3
.
RowStyles
.
Clear
();
this
.
tableLayoutPanel3
.
RowStyles
.
Clear
();
this
.
tableLayoutPanel3
.
RowCount
=
LineManager
.
Config
.
DIList
.
Count
-
count
;
if
(
LineManager
.
Config
.
DIList
.
Count
>
count
)
{
this
.
tableLayoutPanel3
.
RowCount
=
LineManager
.
Config
.
DIList
.
Count
-
count
;
}
else
{
this
.
tableLayoutPanel3
.
RowCount
=
0
;
}
foreach
(
ConfigIO
ioValue
in
LineManager
.
Config
.
DIList
.
Values
)
foreach
(
ConfigIO
ioValue
in
LineManager
.
Config
.
DIList
.
Values
)
{
{
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
ioValue
.
Explain
,
ioValue
.
ProName
);
IOTextControl
control
=
new
IOTextControl
(
ioValue
.
ElectricalDefinition
+
"_"
+
ioValue
.
Explain
,
ioValue
.
ProName
);
...
@@ -197,27 +204,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -197,27 +204,7 @@ namespace OnlineStore.AssemblyLine
control
.
IOValue
=
iov
;
control
.
IOValue
=
iov
;
control
.
ShowData
();
control
.
ShowData
();
}
}
}
}
double
ai1Value
=
AIManager
.
GetAIValue
(
LineManager
.
Config
.
AIDI1_Addr
);
double
ai2Value
=
AIManager
.
GetAIValue
(
LineManager
.
Config
.
AIDI2_Addr
);
double
ai3Value
=
AIManager
.
GetAIValue
(
LineManager
.
Config
.
AIDI3_Addr
);
double
ai4Value
=
AIManager
.
GetAIValue
(
LineManager
.
Config
.
AIDI4_Addr
);
txtAI1
.
Text
=
ai1Value
.
ToString
();
txtAI2
.
Text
=
ai2Value
.
ToString
();
txtAI3
.
Text
=
ai3Value
.
ToString
();
txtAI4
.
Text
=
ai4Value
.
ToString
();
//txtAI3.Text = ai3Value.ToString();
txtAIResult1
.
Text
=
AIManager
.
ConvertAI
(
ai1Value
,
LineManager
.
Config
.
AIDI1_DefaultPosition
).
ToString
();
txtAIResult2
.
Text
=
AIManager
.
ConvertAI
(
ai2Value
,
LineManager
.
Config
.
AIDI2_DefaultPosition
).
ToString
();
txtAIResult3
.
Text
=
AIManager
.
ConvertAI
(
ai3Value
,
LineManager
.
Config
.
AIDI3_DefaultPosition
).
ToString
();
txtAIResult4
.
Text
=
AIManager
.
ConvertAI
(
ai4Value
,
LineManager
.
Config
.
AIDI4_DefaultPosition
).
ToString
();
//txtAIResult3.Text = KNDAIManager.ConvertAI(ai3Value, boxBean.Config.AIDI3_DefaultPosition).ToString();
txtHeight
.
Text
=
LineManager
.
Line
.
GetHeight
().
ToString
();
txtSize
.
Text
=
LineManager
.
Line
.
GetWidth
().
ToString
();
}
}
private
void
btnReadAllDi_Click
(
object
sender
,
EventArgs
e
)
private
void
btnReadAllDi_Click
(
object
sender
,
EventArgs
e
)
...
...
source/AssemblyLineClient/FrmIOStatus.resx
查看文件 @
db95969
...
@@ -121,7 +121,7 @@
...
@@ -121,7 +121,7 @@
<value>17, 11</value>
<value>17, 11</value>
</metadata>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>
2
5</value>
<value>
7
5</value>
</metadata>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
...
...
source/AssemblyLineClient/FrmLineStore.cs
查看文件 @
db95969
...
@@ -43,7 +43,7 @@ namespace OnlineStore.AssemblyLine
...
@@ -43,7 +43,7 @@ namespace OnlineStore.AssemblyLine
}
}
FrmIOStatus
ioStatus
=
new
FrmIOStatus
();
FrmIOStatus
ioStatus
=
new
FrmIOStatus
();
AddForm
(
"
流水线IO状态
"
,
ioStatus
);
AddForm
(
"
流水线IO
"
,
ioStatus
);
List
<
MoveEquip
>
moveEquipList
=
new
List
<
MoveEquip
>(
lineBean
.
MoveEquipMap
.
Values
);
List
<
MoveEquip
>
moveEquipList
=
new
List
<
MoveEquip
>(
lineBean
.
MoveEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
moveEquipList
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
moveEquipList
.
Count
;
i
++)
...
@@ -57,20 +57,30 @@ namespace OnlineStore.AssemblyLine
...
@@ -57,20 +57,30 @@ namespace OnlineStore.AssemblyLine
{
{
FeedingEquip
feed
=
feeds
[
i
];
FeedingEquip
feed
=
feeds
[
i
];
FrmFeedingEquip
test
=
new
FrmFeedingEquip
(
feed
);
FrmFeedingEquip
test
=
new
FrmFeedingEquip
(
feed
);
AddForm
(
" "
+
feed
.
Name
+
"
"
,
test
);
AddForm
(
" "
+
feed
.
Name
+
"
"
,
test
);
}
}
List
<
ProvidingEquip
>
provids
=
new
List
<
ProvidingEquip
>(
lineBean
.
ProvidingEquipMap
.
Values
);
List
<
ProvidingEquip
>
provids
=
new
List
<
ProvidingEquip
>(
lineBean
.
ProvidingEquipMap
.
Values
);
for
(
int
i
=
0
;
i
<
provids
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
provids
.
Count
;
i
++)
{
{
ProvidingEquip
provid
=
provids
[
i
];
ProvidingEquip
provid
=
provids
[
i
];
FrmProvidingEquip
test
=
new
FrmProvidingEquip
(
provid
);
FrmProvidingEquip
test
=
new
FrmProvidingEquip
(
provid
);
AddForm
(
" "
+
provid
.
Name
+
"
"
,
test
);
AddForm
(
" "
+
provid
.
Name
+
" "
,
test
);
}
}
List
<
DischargeLine
>
diss
=
new
List
<
DischargeLine
>(
lineBean
.
DisLineMap
.
Values
);
for
(
int
i
=
0
;
i
<
diss
.
Count
;
i
++)
{
DischargeLine
line
=
diss
[
i
];
FrmDischargeLine
frm
=
new
FrmDischargeLine
(
line
);
AddForm
(
" "
+
line
.
Name
+
" "
,
frm
);
}
lblCID
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_CID
);
lblCID
.
Text
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Line_CID
);
chbLineDebug
.
Checked
=
TrayManager
.
LineRunTest
;
chbLineDebug
.
Checked
=
TrayManager
.
LineRunTest
;
}
}
private
void
AddForm
(
string
text
,
Form
form
)
private
void
AddForm
(
string
text
,
Form
form
)
{
{
text
=
text
.
PadLeft
(
10
,
' '
);
TabPage
lineTabPage
=
new
TabPage
(
text
);
TabPage
lineTabPage
=
new
TabPage
(
text
);
lineTabPage
.
AutoScroll
=
true
;
lineTabPage
.
AutoScroll
=
true
;
lineTabPage
.
Tag
=
lineBean
;
lineTabPage
.
Tag
=
lineBean
;
...
@@ -161,6 +171,15 @@ namespace OnlineStore.AssemblyLine
...
@@ -161,6 +171,15 @@ namespace OnlineStore.AssemblyLine
lvi
.
SubItems
.
Add
(
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
lvi
.
SubItems
.
Add
(
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
this
.
listView1
.
Items
.
Add
(
lvi
);
this
.
listView1
.
Items
.
Add
(
lvi
);
}
}
this
.
listView1
.
Items
.
Add
((
ListViewItem
)
emptyView
.
Clone
());
foreach
(
DischargeLine
equip
in
lineBean
.
DisLineMap
.
Values
)
{
ListViewItem
lvi
=
new
ListViewItem
();
lvi
.
Text
=
equip
.
Name
;
lvi
.
SubItems
.
Add
(
equip
.
alarmType
.
ToString
());
lvi
.
SubItems
.
Add
(
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
this
.
listView1
.
Items
.
Add
(
lvi
);
}
cmbBoxIndex
.
Items
.
Clear
();
cmbBoxIndex
.
Items
.
Clear
();
foreach
(
int
key
in
lineBean
.
MoveEquipMap
.
Keys
)
foreach
(
int
key
in
lineBean
.
MoveEquipMap
.
Keys
)
{
{
...
@@ -428,6 +447,14 @@ namespace OnlineStore.AssemblyLine
...
@@ -428,6 +447,14 @@ namespace OnlineStore.AssemblyLine
SetItemColor
(
i
,
equip
.
runStatus
);
SetItemColor
(
i
,
equip
.
runStatus
);
i
++;
i
++;
}
}
i
++;
foreach
(
DischargeLine
equip
in
lineBean
.
DisLineMap
.
Values
)
{
SetItemText
(
i
,
1
,
equip
.
alarmType
.
ToString
());
SetItemText
(
i
,
2
,
KTK_Store
.
GetRunStr
(
equip
.
lineStatus
,
equip
.
runStatus
));
SetItemColor
(
i
,
equip
.
runStatus
);
i
++;
}
if
(
lineBean
.
runStatus
>
LineRunStatus
.
Wait
)
if
(
lineBean
.
runStatus
>
LineRunStatus
.
Wait
)
{
{
if
(
启动
AToolStripMenuItem
.
Enabled
.
Equals
(
true
))
if
(
启动
AToolStripMenuItem
.
Enabled
.
Equals
(
true
))
...
...
source/AssemblyLineClient/FrmProvidingEquip.Designer.cs
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/AssemblyLineClient/FrmProvidingEquip.cs
查看文件 @
db95969
...
@@ -174,33 +174,10 @@ namespace OnlineStore.AssemblyLine
...
@@ -174,33 +174,10 @@ namespace OnlineStore.AssemblyLine
private
void
FrmStoreIOStatus_Load
(
object
sender
,
EventArgs
e
)
private
void
FrmStoreIOStatus_Load
(
object
sender
,
EventArgs
e
)
{
{
chbDebug
.
Checked
=
providingEquip
.
IsDebug
;
chbDebug
.
Checked
=
providingEquip
.
IsDebug
;
if
(
providingEquip
.
UseAxis
)
{
portName
=
providingEquip
.
Config
.
UpDown_Axis
.
DeviceName
;
SlvAddr
=
providingEquip
.
Config
.
UpDown_Axis
.
GetAxisValue
();
txtAxisDeviceName
.
Text
=
portName
;
txtSlaveId
.
Text
=
SlvAddr
.
ToString
();
comboBox1
.
Items
.
Clear
();
comboBox1
.
Items
.
Add
(
providingEquip
.
Config
.
UpDown_Axis
.
Explain
);
comboBox1
.
SelectedIndex
=
0
;
txtAxisValue
.
Text
=
SlvAddr
.
ToString
();
}
else
{
tabControl1
.
TabPages
.
Remove
(
tabPage2
);
}
cmbSizeList
.
Items
.
Clear
();
cmbSizeList
.
Items
.
Add
(
"0=默认位置"
);
for
(
int
i
=
8
;
i
<=
48
;
i
=
i
+
4
)
{
cmbSizeList
.
Items
.
Add
(
i
.
ToString
());
}
cmbSizeList
.
SelectedIndex
=
0
;
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
providingEquip
.
lineStatus
,
providingEquip
.
runStatus
);
lblStoreStatus
.
Text
=
KTK_Store
.
GetRunStr
(
providingEquip
.
lineStatus
,
providingEquip
.
runStatus
);
lblThisSta
.
Text
=
providingEquip
.
WarnMsg
;
lblThisSta
.
Text
=
providingEquip
.
WarnMsg
;
txtP1
.
Text
=
providingEquip
.
Config
.
UpDownAxisP1
.
ToString
();
IsLoad
=
true
;
IsLoad
=
true
;
}
}
...
@@ -459,184 +436,14 @@ namespace OnlineStore.AssemblyLine
...
@@ -459,184 +436,14 @@ namespace OnlineStore.AssemblyLine
btnClampSlack
.
Text
=
"夹料气缸夹紧"
;
btnClampSlack
.
Text
=
"夹料气缸夹紧"
;
btnClampSlack
.
BackColor
=
Color
.
SkyBlue
;
btnClampSlack
.
BackColor
=
Color
.
SkyBlue
;
}
}
}
private
void
btnOpenAxis_Click
(
object
sender
,
EventArgs
e
)
{
string
portName
=
txtAxisDeviceName
.
Text
;
short
SlvAddr
=
FormUtil
.
GetShortValue
(
txtAxisValue
);
LogUtil
.
info
(
"点击【打开伺服】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 "
);
ACServerManager
.
OpenPort
(
portName
);
ACServerManager
.
AlarmClear
(
portName
,
SlvAddr
);
Thread
.
Sleep
(
100
);
ACServerManager
.
ServoOn
(
portName
,
SlvAddr
);
}
private
void
btnCloseAxis_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击【关闭伺服】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 "
);
ACServerManager
.
ServoOff
(
portName
,
SlvAddr
);
}
private
void
btnAxisAMove_Click
(
object
sender
,
EventArgs
e
)
{
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【绝对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
private
void
btnAxisRMove_Click
(
object
sender
,
EventArgs
e
)
{
int
position
=
FormUtil
.
GetIntValue
(
txtAPosition
);
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【相对运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
RelMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
private
void
btnAxisVMove_Click
(
object
sender
,
EventArgs
e
)
{
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【匀速运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
SpeedMove
(
portName
,
SlvAddr
,
speed
);
}
private
void
btnAxisStop_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击【停止运动】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 "
);
ACServerManager
.
SuddenStop
(
portName
,
SlvAddr
);
}
private
void
btnComAlarmClear_Click
(
object
sender
,
EventArgs
e
)
{
LogUtil
.
info
(
"点击【清理报警】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 "
);
ACServerManager
.
AlarmClear
(
portName
,
SlvAddr
);
Thread
.
Sleep
(
100
);
ACServerManager
.
ServoOn
(
portName
,
SlvAddr
);
}
private
void
btnAxisReturnHome_Click
(
object
sender
,
EventArgs
e
)
{
int
speed
=
FormUtil
.
GetIntValue
(
txtASpeed
);
LogUtil
.
info
(
"点击【原点返回】,端口号【"
+
portName
+
"】地址【"
+
SlvAddr
+
"】 速度【"
+
speed
+
"】"
);
ACServerManager
.
HomeMove
(
portName
,
SlvAddr
,
speed
);
}
private
void
btnGetAlarm_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetAlarmStatus
(
portName
,
SlvAddr
);
this
.
txtAlarmStatus
.
Text
=
value
.
ToString
();
}
private
void
button1_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetBusyStatus
(
portName
,
SlvAddr
);
this
.
txtBusyStatus
.
Text
=
value
.
ToString
();
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetHomeEndStatus
(
portName
,
SlvAddr
);
this
.
txtHomeStatus
.
Text
=
value
.
ToString
();
}
}
private
void
btnReadHomeSingle_Click
(
object
sender
,
EventArgs
e
)
{
int
value
=
ACServerManager
.
GetHomeSingle
(
portName
,
SlvAddr
);
this
.
txtHomeSingle
.
Text
=
value
.
ToString
();
}
private
void
btnReadPosition_Click
(
object
sender
,
EventArgs
e
)
{
lblOutPulse
.
Text
=
ACServerManager
.
GetTargetPosition
(
portName
,
SlvAddr
).
ToString
();
lblCountPulse
.
Text
=
ACServerManager
.
GetActualtPosition
(
portName
,
SlvAddr
).
ToString
();
}
private
void
cmbSizeList_SelectedIndexChanged
(
object
sender
,
EventArgs
e
)
{
if
(
cmbSizeList
.
SelectedIndex
<
0
)
{
return
;
}
int
size
=
0
;
try
{
size
=
Convert
.
ToInt32
(
cmbSizeList
.
Text
);
}
catch
(
Exception
ex
)
{
}
txtSizePosition
.
Text
=
providingEquip
.
Config
.
GetUpdownPosition
(
size
).
ToString
();
txtBoxP
.
Text
=
providingEquip
.
Config
.
GetUpdownBoxPosition
(
size
).
ToString
();
btnMoveto
.
Text
=
size
+
"寸移栽位置 :"
;
btnBoxP
.
Text
=
size
+
"寸料仓门口位置 :"
;
// btnMoveto.Text = "尺寸" + size + "对应位置:";
}
private
void
btnMoveto_Click
(
object
sender
,
EventArgs
e
)
{
int
position
=
FormUtil
.
GetIntValue
(
txtSizePosition
);
if
(
position
!=
-
1
)
{
int
speed
=
providingEquip
.
Config
.
UpdownAxis_DownSpeed
;
LogUtil
.
info
(
"点击【移栽位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
private
void
btnAxisOn_Click
(
object
sender
,
EventArgs
e
)
{
this
.
Enabled
=
false
;
providingEquip
.
RunAxis
(
false
,
providingEquip
.
Config
.
UpDown_Axis
);
this
.
Enabled
=
true
;
LogUtil
.
info
(
"伺服运转ON完成"
);
}
private
void
btnAxisOff_Click
(
object
sender
,
EventArgs
e
)
{
providingEquip
.
CloseAxis
();
LogUtil
.
info
(
"伺服运转OFF完成"
);
}
private
void
btnCloseAll_Click
(
object
sender
,
EventArgs
e
)
private
void
btnCloseAll_Click
(
object
sender
,
EventArgs
e
)
{
{
IOManager
.
instance
.
CloseAllDO
();
IOManager
.
instance
.
CloseAllDO
();
}
}
private
void
button3_Click
(
object
sender
,
EventArgs
e
)
{
int
position
=
FormUtil
.
GetIntValue
(
txtP1
);
if
(
position
!=
-
1
)
{
int
speed
=
providingEquip
.
Config
.
UpdownAxis_P1Speed
;
LogUtil
.
info
(
"点击【P1点测试】, 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
private
void
btnSave_Click
(
object
sender
,
EventArgs
e
)
{
int
p1Position
=
FormUtil
.
GetIntValue
(
txtP1
);
providingEquip
.
Config
.
UpDownAxisP1
=
p1Position
;
int
size
=
0
;
try
{
size
=
Convert
.
ToInt32
(
cmbSizeList
.
Text
);
}
catch
(
Exception
ex
)
{
}
int
sizePosition
=
FormUtil
.
GetIntValue
(
txtSizePosition
);
int
sizeBoxP
=
FormUtil
.
GetIntValue
(
txtBoxP
);
providingEquip
.
Config
.
UpdateUpdownPositon
(
size
,
sizePosition
);
providingEquip
.
Config
.
UpdateUpdownBoxPositon
(
size
,
sizeBoxP
);
LineManager
.
SaveProvidingEquipConfig
(
providingEquip
.
Config
);
MessageBox
.
Show
(
"保存成功!"
);
}
private
void
btnBoxP_Click
(
object
sender
,
EventArgs
e
)
{
int
position
=
FormUtil
.
GetIntValue
(
txtBoxP
);
if
(
position
!=
-
1
)
{
int
speed
=
providingEquip
.
Config
.
UpdownAxis_DownSpeed
;
LogUtil
.
info
(
"点击【料仓门口下降位置】,料盘高度【"
+
cmbSizeList
.
Text
+
"】 位置【"
+
position
+
"】速度【"
+
speed
+
"】"
);
ACServerManager
.
AbsMove
(
portName
,
SlvAddr
,
position
,
speed
);
}
}
}
}
}
}
source/Common/Setting_Init.cs
查看文件 @
db95969
...
@@ -70,5 +70,7 @@ namespace OnlineStore.Common
...
@@ -70,5 +70,7 @@ namespace OnlineStore.Common
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
ACBaudRate
=
"ACBaudRate"
;
public
static
string
LineRunTest
=
"LineRunTest"
;
public
static
string
LineRunTest
=
"LineRunTest"
;
public
static
string
Line_dischargeLine_count
=
"Line_dischargeLine_count"
;
public
static
string
ConfigPath_DischargeLine
=
"ConfigPath_DischargeLine"
;
}
}
}
}
source/Common/util/ConfigAppSettings.cs
查看文件 @
db95969
...
@@ -170,6 +170,17 @@ namespace OnlineStore.Common
...
@@ -170,6 +170,17 @@ 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 保存设置
///</summary>
///</summary>
...
...
source/DeviceLibrary/DeviceLibrary.csproj
查看文件 @
db95969
...
@@ -60,6 +60,8 @@
...
@@ -60,6 +60,8 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile Include="assemblyLine\AssemblyLineManager.cs" />
<Compile Include="assemblyLine\AssemblyLineManager.cs" />
<Compile Include="assemblyLine\DischargeLine.cs" />
<Compile Include="assemblyLine\DischargeLine_Partial.cs" />
<Compile Include="assemblyLine\ProvidingEquip_Partial.cs" />
<Compile Include="assemblyLine\ProvidingEquip_Partial.cs" />
<Compile Include="assemblyLine\FeedingEquip_Partial.cs" />
<Compile Include="assemblyLine\FeedingEquip_Partial.cs" />
<Compile Include="assemblyLine\ProvidingEquip.cs" />
<Compile Include="assemblyLine\ProvidingEquip.cs" />
...
@@ -129,9 +131,15 @@
...
@@ -129,9 +131,15 @@
<None Include="LineConfig\Config_Line.csv">
<None Include="LineConfig\Config_Line.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="LineConfig\Config_DischargeLine_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LineConfig\Config_ProvidingEquip_1.csv">
<None Include="LineConfig\Config_ProvidingEquip_1.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
<None Include="LineConfig\Config_DischargeLine_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="LineConfig\Config_ProvidingEquip_2.csv">
<None Include="LineConfig\Config_ProvidingEquip_2.csv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</None>
...
...
source/DeviceLibrary/LineConfig/Config_DischargeLine_1.csv
0 → 100644
查看文件 @
db95969
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
,,,,,,,,,
DI,0,皮带线1定位检测,Location_Check1,0,192.168.200.12,0,皮带线1定位检测,X021,X021
DI,0,皮带线1入口料盘检测,EntryPosition_Check1,1,192.168.200.12,0,皮带线1入口料盘检测,X022,X022
DI,0,皮带线1出口料盘检测,ExitPosition_Check1,2,192.168.200.12,0,皮带线1出口料盘检测,X023,X023
DI,0,皮带线2定位检测,Location_Check2,3,192.168.200.12,0,皮带线2定位检测,X024,X024
DI,0,皮带线2入口料盘检测,EntryPosition_Check2,4,192.168.200.12,0,皮带线2入口料盘检测,X025,X025
DI,0,皮带线2出口料盘检测,ExitPosition_Check2,5,192.168.200.12,0,皮带线2出口料盘检测,X026,X026
DI,0,皮带线3定位检测,Location_Check3,6,192.168.200.12,0,皮带线3定位检测,X027,X027
DI,0,皮带线3入口料盘检测,EntryPosition_Check3,7,192.168.200.12,0,皮带线3入口料盘检测,X028,X028
DI,0,皮带线3中间位置料盘检测,MiddlePosition_Check3,8,192.168.200.12,0,皮带线3中间位置料盘检测,X029,X029
DI,0,皮带线3出口料盘检测,ExitPosition_Check3,9,192.168.200.12,0,皮带线3出口料盘检测,X030,X030
DI,0,分盘装置1定位气缸上升端,SeparateDevice_Up,10,192.168.200.12,0,分盘装置1定位气缸上升端,X031,X031
DI,0,分盘装置1定位气缸下降端,SeparateDevice_Down,11,192.168.200.12,0,分盘装置1定位气缸下降端,X032,X032
DI,0,分盘装置1料盘检测,SeparateDevice_Check,12,192.168.200.12,0,分盘装置1料盘检测,X033,X033
,0,,,13,192.168.200.12,0,,X034,X034
,0,,,14,192.168.200.12,0,,X035,X035
,0,,,15,192.168.200.12,0,,X036,X036
,,,,,,,,,
DO,0,出料皮带线1运转,LineRun_1,0,192.168.200.12,0,出料皮带线1运转,Y021,Y021
DO,0,出料皮带线2运转,LineRun_2,1,192.168.200.12,0,出料皮带线2运转,Y022,Y022
DO,0,出料皮带线3运转,LineRun_3,2,192.168.200.12,0,出料皮带线3运转,Y023,Y023
DO,0,分盘装置电机驱动,SeparateDevice_Run,3,192.168.200.12,0,分盘装置电机驱动,Y024,Y024
DO,0,分盘装置1定位气缸上升SOL,SeparateDevice_Up,4,192.168.200.12,0,分盘装置1定位气缸上升SOL,Y025,Y025
DO,0,分盘装置1定位气缸下降SOL,SeparateDevice_Down,5,192.168.200.12,0,分盘装置1定位气缸下降SOL,Y026,Y026
,0,,,6,192.168.200.12,0,,Y027,Y027
,0,,,7,192.168.200.12,0,,Y028,Y028
,0,,,8,192.168.200.12,0,,Y029,Y029
,0,,,9,192.168.200.12,0,,Y030,Y030
,0,,,10,192.168.200.12,0,,Y031,Y031
,0,,,11,192.168.200.12,0,,Y032,Y032
,0,,,12,192.168.200.12,0,,Y033,Y033
,0,,,13,192.168.200.12,0,,Y034,Y034
,0,,,14,192.168.200.12,0,,Y035,Y035
,0,,,15,192.168.200.12,0,,Y036,Y036
source/DeviceLibrary/LineConfig/Config_DischargeLine_2.csv
0 → 100644
查看文件 @
db95969
类型,分类编号,说明,名称,属性值,设备名称,默认值,描述,电器定义,代码定义
PRO,0,设备是否处于调试状态(1=调试,0=正常),IsDebug,1,,,,,
,,,,,,,,,
DI,0,皮带线4定位检测,Location_Check1,0,192.168.200.13,0,皮带线4定位检测,X041,X041
DI,0,皮带线4入口料盘检测,EntryPosition_Check1,1,192.168.200.13,0,皮带线4入口料盘检测,X042,X042
DI,0,皮带线4出口料盘检测,ExitPosition_Check1,2,192.168.200.13,0,皮带线4出口料盘检测,X043,X043
DI,0,皮带线5定位检测,Location_Check2,3,192.168.200.13,0,皮带线5定位检测,X044,X044
DI,0,皮带线5入口料盘检测,EntryPosition_Check2,4,192.168.200.13,0,皮带线5入口料盘检测,X045,X045
DI,0,皮带线5出口料盘检测,ExitPosition_Check2,5,192.168.200.13,0,皮带线5出口料盘检测,X046,X046
DI,0,皮带线6定位检测,Location_Check3,6,192.168.200.13,0,皮带线6定位检测,X047,X047
DI,0,皮带线6入口料盘检测,EntryPosition_Check3,7,192.168.200.13,0,皮带线6入口料盘检测,X048,X048
DI,0,皮带线6中间位置料盘检测,MiddlePosition_Check3,8,192.168.200.13,0,皮带线6中间位置料盘检测,X049,X049
DI,0,皮带线6出口料盘检测,ExitPosition_Check3,9,192.168.200.13,0,皮带线6出口料盘检测,X050,X050
DI,0,分盘装置2定位气缸上升端,SeparateDevice_Up,10,192.168.200.13,0,分盘装置2定位气缸上升端,X051,X051
DI,0,分盘装置2定位气缸下降端,SeparateDevice_Down,11,192.168.200.13,0,分盘装置2定位气缸下降端,X052,X052
DI,0,分盘装置1料盘检测,SeparateDevice_Check,12,192.168.200.13,0,分盘装置1料盘检测,X053,X053
,0,,,13,192.168.200.13,0,,X054,X054
,0,,,14,192.168.200.13,0,,X055,X055
,0,,,15,192.168.200.13,0,,X056,X056
,,,,,,,,,
DO,0,出料皮带线1运转,LineRun_1,0,192.168.200.13,0,出料皮带线1运转,Y041,Y041
DO,0,出料皮带线2运转,LineRun_2,1,192.168.200.13,0,出料皮带线2运转,Y042,Y042
DO,0,出料皮带线3运转,LineRun_3,2,192.168.200.13,0,出料皮带线3运转,Y043,Y043
DO,0,分盘装置电机驱动,SeparateDevice_Run,3,192.168.200.13,0,分盘装置电机驱动,Y044,Y044
DO,0,分盘装置1定位气缸上升SOL,SeparateDevice_Up,4,192.168.200.13,0,分盘装置1定位气缸上升SOL,Y045,Y045
DO,0,分盘装置1定位气缸下降SOL,SeparateDevice_Down,5,192.168.200.13,0,分盘装置1定位气缸下降SOL,Y046,Y046
,0,,,6,192.168.200.13,0,,Y047,Y047
,0,,,7,192.168.200.13,0,,Y048,Y048
,0,,,8,192.168.200.13,0,,Y049,Y049
,0,,,9,192.168.200.13,0,,Y050,Y050
,0,,,10,192.168.200.13,0,,Y051,Y051
,0,,,11,192.168.200.13,0,,Y052,Y052
,0,,,12,192.168.200.13,0,,Y053,Y053
,0,,,13,192.168.200.13,0,,Y054,Y054
,0,,,14,192.168.200.13,0,,Y055,Y055
,0,,,15,192.168.200.13,0,,Y056,Y056
source/DeviceLibrary/LineConfig/Config_Line.csv
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/AssemblyLineManager.cs
查看文件 @
db95969
...
@@ -25,6 +25,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -25,6 +25,7 @@ namespace OnlineStore.DeviceLibrary
public
static
Dictionary
<
int
,
MoveEquip_Config
>
moveECMap
=
null
;
public
static
Dictionary
<
int
,
MoveEquip_Config
>
moveECMap
=
null
;
public
static
Dictionary
<
int
,
FeedingEquip_Config
>
feedingECMap
=
null
;
public
static
Dictionary
<
int
,
FeedingEquip_Config
>
feedingECMap
=
null
;
public
static
Dictionary
<
int
,
ProvidingEquip_Config
>
providingECMap
=
null
;
public
static
Dictionary
<
int
,
ProvidingEquip_Config
>
providingECMap
=
null
;
public
static
Dictionary
<
int
,
DischargeLine_Config
>
disChargeLineMap
=
null
;
public
LineManager
()
public
LineManager
()
{
{
}
}
...
@@ -56,6 +57,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -56,6 +57,7 @@ namespace OnlineStore.DeviceLibrary
moveECMap
=
new
Dictionary
<
int
,
MoveEquip_Config
>();
moveECMap
=
new
Dictionary
<
int
,
MoveEquip_Config
>();
feedingECMap
=
new
Dictionary
<
int
,
FeedingEquip_Config
>();
feedingECMap
=
new
Dictionary
<
int
,
FeedingEquip_Config
>();
providingECMap
=
new
Dictionary
<
int
,
ProvidingEquip_Config
>();
providingECMap
=
new
Dictionary
<
int
,
ProvidingEquip_Config
>();
disChargeLineMap
=
new
Dictionary
<
int
,
DischargeLine_Config
>();
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
string
server
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
http_server
);
if
(
server
.
Equals
(
""
))
if
(
server
.
Equals
(
""
))
{
{
...
@@ -114,7 +116,20 @@ namespace OnlineStore.DeviceLibrary
...
@@ -114,7 +116,20 @@ namespace OnlineStore.DeviceLibrary
moveConfig
.
SetIO
(
subType
);
moveConfig
.
SetIO
(
subType
);
providingECMap
.
Add
(
i
,
moveConfig
);
providingECMap
.
Add
(
i
,
moveConfig
);
}
}
Line
=
new
LineBean
(
Config
,
moveECMap
,
feedingECMap
,
providingECMap
);
int
dislineCount
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
Line_dischargeLine_count
);
string
dischargeLineConfig
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ConfigPath_DischargeLine
);
for
(
int
i
=
1
;
i
<=
dislineCount
;
i
++)
{
int
subType
=
300
+
i
;
string
config
=
appPath
+
dischargeLineConfig
.
Replace
(
".csv"
,
"_"
+
i
+
".csv"
);
DischargeLine_Config
moveConfig
=
CSVConfigReader
.
LoadDischargeLineConfig
(
subType
,
config
);
moveConfig
.
SetIO
(
subType
);
disChargeLineMap
.
Add
(
i
,
moveConfig
);
}
Line
=
new
LineBean
(
Config
,
moveECMap
,
feedingECMap
,
providingECMap
,
disChargeLineMap
);
LogUtil
.
info
(
LOGGER
,
"加载 完成!"
);
LogUtil
.
info
(
LOGGER
,
"加载 完成!"
);
return
Line
;
return
Line
;
}
}
...
@@ -218,5 +233,27 @@ namespace OnlineStore.DeviceLibrary
...
@@ -218,5 +233,27 @@ namespace OnlineStore.DeviceLibrary
LOGGER
.
Error
(
"出错:"
,
ex
);
LOGGER
.
Error
(
"出错:"
,
ex
);
}
}
}
}
public
static
void
SaveDischargeLineConfig
(
DischargeLine_Config
config
)
{
try
{
//位置配置到文件中
string
appPath
=
Application
.
StartupPath
;
string
moveEquipConfig
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
ConfigPath_DischargeLine
);
int
id
=
config
.
Id
-
300
;
string
configStr
=
appPath
+
moveEquipConfig
.
Replace
(
".csv"
,
"_"
+
id
+
".csv"
);
disChargeLineMap
[
config
.
Id
]
=
config
;
bool
result
=
CSVConfigReader
.
SaveConfig
(
configStr
,
config
,
typeof
(
DischargeLine_Config
));
if
(!
result
)
{
LOGGER
.
Error
(
"保存配置文件失败:"
+
configStr
);
}
}
catch
(
Exception
ex
)
{
LOGGER
.
Error
(
"出错:"
,
ex
);
}
}
}
}
}
}
source/DeviceLibrary/assemblyLine/DischargeLine.cs
0 → 100644
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/DischargeLine_Partial.cs
0 → 100644
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/DeviceLibrary/assemblyLine/LineBean.cs
查看文件 @
db95969
...
@@ -40,6 +40,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -40,6 +40,7 @@ namespace OnlineStore.DeviceLibrary
public
Dictionary
<
int
,
FeedingEquip
>
FeedingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
FeedingEquip
>
FeedingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
ProvidingEquip
>
ProvidingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
ProvidingEquip
>
ProvidingEquipMap
{
get
;
set
;
}
public
Dictionary
<
int
,
DischargeLine
>
DisLineMap
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 流水线配置
/// 流水线配置
...
@@ -48,7 +49,8 @@ namespace OnlineStore.DeviceLibrary
...
@@ -48,7 +49,8 @@ namespace OnlineStore.DeviceLibrary
private
bool
canStart
=
false
;
private
bool
canStart
=
false
;
public
LineBean
(
Line_Config
lineConfig
,
Dictionary
<
int
,
MoveEquip_Config
>
configList
,
Dictionary
<
int
,
FeedingEquip_Config
>
feedMap
,
Dictionary
<
int
,
ProvidingEquip_Config
>
providMap
)
public
LineBean
(
Line_Config
lineConfig
,
Dictionary
<
int
,
MoveEquip_Config
>
configList
,
Dictionary
<
int
,
FeedingEquip_Config
>
feedMap
,
Dictionary
<
int
,
ProvidingEquip_Config
>
providMap
,
Dictionary
<
int
,
DischargeLine_Config
>
disLineMap
)
{
{
if
(
lineConfig
.
IOSingle_TimerOut
<=
0
)
if
(
lineConfig
.
IOSingle_TimerOut
<=
0
)
{
{
...
@@ -68,7 +70,7 @@ namespace OnlineStore.DeviceLibrary
...
@@ -68,7 +70,7 @@ namespace OnlineStore.DeviceLibrary
MoveEquipMap
=
new
Dictionary
<
int
,
MoveEquip
>();
MoveEquipMap
=
new
Dictionary
<
int
,
MoveEquip
>();
FeedingEquipMap
=
new
Dictionary
<
int
,
FeedingEquip
>();
FeedingEquipMap
=
new
Dictionary
<
int
,
FeedingEquip
>();
ProvidingEquipMap
=
new
Dictionary
<
int
,
ProvidingEquip
>();
ProvidingEquipMap
=
new
Dictionary
<
int
,
ProvidingEquip
>();
DisLineMap
=
new
Dictionary
<
int
,
DischargeLine
>();
List
<
string
>
ioList
=
new
List
<
string
>();
List
<
string
>
ioList
=
new
List
<
string
>();
AddDeviceName
(
ioList
,
Config
.
IOIPList
);
AddDeviceName
(
ioList
,
Config
.
IOIPList
);
...
@@ -93,6 +95,13 @@ namespace OnlineStore.DeviceLibrary
...
@@ -93,6 +95,13 @@ namespace OnlineStore.DeviceLibrary
AddDeviceName
(
ioList
,
config
.
IOIPList
);
AddDeviceName
(
ioList
,
config
.
IOIPList
);
ProvidingEquipMap
.
Add
(
config
.
Id
,
equip
);
ProvidingEquipMap
.
Add
(
config
.
Id
,
equip
);
}
}
foreach
(
DischargeLine_Config
config
in
disLineMap
.
Values
)
{
DischargeLine
equip
=
new
DischargeLine
(
lineConfig
.
CID
,
config
);
AddDeviceName
(
ioList
,
config
.
IOIPList
);
DisLineMap
.
Add
(
config
.
Id
,
equip
);
}
IOManager
.
Init
();
IOManager
.
Init
();
//先初始化设备
//先初始化设备
...
...
source/LoadCVSLibrary/LoadCSVLibrary.csproj
查看文件 @
db95969
...
@@ -51,6 +51,7 @@
...
@@ -51,6 +51,7 @@
<Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\ConfigProAttribute.cs" />
<Compile Include="storeConfig\config\Line_Config.cs" />
<Compile Include="storeConfig\config\Line_Config.cs" />
<Compile Include="storeConfig\config\FeedingEquip_Config.cs" />
<Compile Include="storeConfig\config\FeedingEquip_Config.cs" />
<Compile Include="storeConfig\config\DischargeLine_Config.cs" />
<Compile Include="storeConfig\config\ProvidingEquip_Config.cs" />
<Compile Include="storeConfig\config\ProvidingEquip_Config.cs" />
<Compile Include="storeConfig\config\MoveEquip_Config.cs" />
<Compile Include="storeConfig\config\MoveEquip_Config.cs" />
<Compile Include="storeConfig\config\StoreType.cs" />
<Compile Include="storeConfig\config\StoreType.cs" />
...
...
source/LoadCVSLibrary/storeConfig/CSVConfigReader.cs
查看文件 @
db95969
...
@@ -140,6 +140,14 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -140,6 +140,14 @@ namespace OnlineStore.LoadCSVLibrary
return
(
Line_Config
)
LoadConfig
(
config
);
return
(
Line_Config
)
LoadConfig
(
config
);
}
}
public
static
DischargeLine_Config
LoadDischargeLineConfig
(
int
storeId
,
string
filePath
)
{
DischargeLine_Config
config
=
new
DischargeLine_Config
(
storeId
,
storeId
+
"_DischargeLine"
,
""
,
filePath
);
return
(
DischargeLine_Config
)
LoadConfig
(
config
);
}
public
static
MoveEquip_Config
LoadMoveConfig
(
int
storeId
,
string
filePath
)
public
static
MoveEquip_Config
LoadMoveConfig
(
int
storeId
,
string
filePath
)
{
{
MoveEquip_Config
config
=
new
MoveEquip_Config
(
storeId
,
storeId
+
"_MoveEquip"
,
""
,
filePath
);
MoveEquip_Config
config
=
new
MoveEquip_Config
(
storeId
,
storeId
+
"_MoveEquip"
,
""
,
filePath
);
...
...
source/LoadCVSLibrary/storeConfig/config/DischargeLine_Config.cs
0 → 100644
查看文件 @
db95969
using
log4net
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Reflection
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
OnlineStore.LoadCSVLibrary
{
public
class
DischargeLine_Config
:
StoreConfig
{
public
DischargeLine_Config
()
:
base
()
{
}
public
DischargeLine_Config
(
int
id
,
string
cid
,
string
type
,
string
filepath
)
:
base
(
id
,
cid
,
type
,
filepath
)
{
}
/// <summary>
/// 设备是否处于调试状态(1=调试,0=正常)
/// </summary>
[
ConfigProAttribute
(
"IsDebug"
)]
public
int
IsDebug
{
get
;
set
;
}
}
}
source/LoadCVSLibrary/storeConfig/config/IO_Type.cs
查看文件 @
db95969
此文件的差异被折叠,
点击展开。
source/LoadCVSLibrary/storeConfig/config/Line_Config.cs
查看文件 @
db95969
...
@@ -193,62 +193,108 @@ namespace OnlineStore.LoadCSVLibrary
...
@@ -193,62 +193,108 @@ namespace OnlineStore.LoadCSVLibrary
{
{
MustHaveDIList
=
new
List
<
string
>();
MustHaveDIList
=
new
List
<
string
>();
MustHaveDOList
=
new
List
<
string
>();
MustHaveDOList
=
new
List
<
string
>();
MustHaveDIList
.
Add
(
IO_Type
.
SuddenStop_BTN
);
// DI,0,急停,SuddenStop_BTN,0,192.168.200.11,0,急停,X001,X001
//DI,0,复位,Reset_BTN,1,192.168.200.11,0,复位,X002,X002
//DI,0,联动,Start_BTN,2,192.168.200.11,0,联动,X003,X003
//DI,0,气压检测,Airpressure_Check,3,192.168.200.11,0,气压检测,X004,X004
//DI,0,NG料盘推出气缸前进端,NGCylinder_Before,4,192.168.200.11,0,NG料盘推出气缸前进端,X005,X005
//DI,0,NG料盘推出气缸后退端,NGCylinder_After,5,192.168.200.11,0,NG料盘推出气缸后退端,X006,X006
//DI,0,环形线横移4定位上升端,TopCylinder_UP,6,192.168.200.11,0,环形线横移4定位上升端,X007,X007
//DI,0,环形线横移4定位下降端,TopCylinder_Down,7,192.168.200.11,0,环形线横移4定位下降端,X008,X008
MustHaveDIList
.
Add
(
IO_Type
.
SuddenStop_BTN
);
MustHaveDIList
.
Add
(
IO_Type
.
Reset_BTN
);
MustHaveDIList
.
Add
(
IO_Type
.
Reset_BTN
);
MustHaveDIList
.
Add
(
IO_Type
.
Start_BTN
);
MustHaveDIList
.
Add
(
IO_Type
.
Start_BTN
);
MustHaveDIList
.
Add
(
IO_Type
.
Line_Run
);
MustHaveDIList
.
Add
(
IO_Type
.
Airpressure_Check
);
MustHaveDIList
.
Add
(
IO_Type
.
Airpressure_Check
);
MustHaveDIList
.
Add
(
IO_Type
.
InStore_TrayCheck1
);
MustHaveDIList
.
Add
(
IO_Type
.
NGCylinder_Before
);
MustHaveDIList
.
Add
(
IO_Type
.
InStore_TrayCheck2
);
MustHaveDIList
.
Add
(
IO_Type
.
NGCylinder_After
);
MustHaveDIList
.
Add
(
IO_Type
.
StopCylinder_Check
);
MustHaveDIList
.
Add
(
IO_Type
.
TopCylinder_UP
);
MustHaveDIList
.
Add
(
IO_Type
.
Fixture_Check_1
);
MustHaveDIList
.
Add
(
IO_Type
.
TopCylinder_Down
);
MustHaveDIList
.
Add
(
IO_Type
.
Fixture_Check_2
);
MustHaveDIList
.
Add
(
IO_Type
.
Fixture_Check_3
);
// DO,0,待机状态(指示灯),AutoRun_HddLed,0,192.168.200.11,0,待机状态(指示灯),Y001,Y001
MustHaveDIList
.
Add
(
IO_Type
.
Fixture_Check_4
);
//DO,0,运行状态(指示灯),RunSign_HddLed,1,192.168.200.11,0,运行状态(指示灯),Y002,Y002
MustHaveDIList
.
Add
(
IO_Type
.
InStore_TopCylinder_Up
);
//DO,0,故障状态(指示灯),Alarm_HddLed,2,192.168.200.11,0,故障状态(指示灯),Y003,Y003
MustHaveDIList
.
Add
(
IO_Type
.
InStore_TopCylinder_Down
);
//DO,0,故障状态(蜂鸣器),Alarm_Buzzer,3,192.168.200.11,0,故障状态(蜂鸣器),Y004,Y004
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay1_StopFixtureCheck
);
//DO,0,驱动电机1正转,DriveMotor_1,4,192.168.200.11,0,驱动电机1正转,Y005,Y005
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay1_FixtureCheck
);
//DO,0,驱动电机2正转,DriveMotor_2,5,192.168.200.11,0,驱动电机2正转,Y006,Y006
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay1_TopCylinder_Up
);
//DO,0,驱动电机3正转,DriveMotor_3,6,192.168.200.11,0,驱动电机3正转,Y007,Y007
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay1_TopCylinder_Down
);
//DO,0,驱动电机4正转,DriveMotor_4,7,192.168.200.11,0,驱动电机4正转,Y008,Y008
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay2_FixtureCheck
);
//DO,0,环形线横移4电机运转,DriveMotor_Run,8,192.168.200.11,0,环形线横移4电机运转,Y009,Y009
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay2_TopCylinder_Up
);
//DO,0,NG料盘推出气缸前进SOL,NGCylinder_Before,9,192.168.200.11,0,NG料盘推出气缸前进SOL,Y010,Y010
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay2_TopCylinder_Down
);
//DO,0,NG料盘推出气缸后退SOL,NGCylinder_After,10,192.168.200.11,0,NG料盘推出气缸后退SOL,Y011,Y011
MustHaveDIList
.
Add
(
IO_Type
.
DriveMotor_INV1
);
//DO,0,环形线横移4定位上升SOL,TopCylinder_UP,11,192.168.200.11,0,环形线横移4定位上升SOL,Y012,Y012
MustHaveDIList
.
Add
(
IO_Type
.
DriveMotor_INV2
);
//DO,0,环形线横移4定位下降SOL,TopCylinder_Down,12,192.168.200.11,0,环形线横移4定位下降SOL,Y013,Y013
MustHaveDOList
.
Add
(
IO_Type
.
AutoRun_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
AutoRun_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
RunSign_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
RunSign_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
Alarm_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
Alarm_HddLed
);
MustHaveDOList
.
Add
(
IO_Type
.
Alarm_Buzzer
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_1
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_2
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_3
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_4
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_Run
);
MustHaveDOList
.
Add
(
IO_Type
.
DriveMotor_Run
);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay12_DriveMotor
);
MustHaveDOList
.
Add
(
IO_Type
.
NGCylinder_Before
);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay34_DriveMotor
);
MustHaveDOList
.
Add
(
IO_Type
.
NGCylinder_After
);
MustHaveDOList
.
Add
(
IO_Type
.
TopCylinder_UP
);
MustHaveDOList
.
Add
(
IO_Type
.
TopCylinder_Down
);
//MustHaveDIList.Add(IO_Type.SuddenStop_BTN);
//MustHaveDIList.Add(IO_Type.Reset_BTN);
//MustHaveDIList.Add(IO_Type.Start_BTN);
//MustHaveDIList.Add(IO_Type.Line_Run);
//MustHaveDIList.Add(IO_Type.Airpressure_Check);
//MustHaveDIList.Add(IO_Type.InStore_TrayCheck1);
//MustHaveDIList.Add(IO_Type.InStore_TrayCheck2);
//MustHaveDIList.Add(IO_Type.StopCylinder_Check);
//MustHaveDIList.Add(IO_Type.Fixture_Check_1);
//MustHaveDIList.Add(IO_Type.Fixture_Check_2);
//MustHaveDIList.Add(IO_Type.Fixture_Check_3);
//MustHaveDIList.Add(IO_Type.Fixture_Check_4);
//MustHaveDIList.Add(IO_Type.InStore_TopCylinder_Up);
//MustHaveDIList.Add(IO_Type.InStore_TopCylinder_Down);
//MustHaveDIList.Add(IO_Type.SidesWay1_StopFixtureCheck);
//MustHaveDIList.Add(IO_Type.SidesWay1_FixtureCheck);
//MustHaveDIList.Add(IO_Type.SidesWay1_TopCylinder_Up);
//MustHaveDIList.Add(IO_Type.SidesWay1_TopCylinder_Down);
//MustHaveDIList.Add(IO_Type.SidesWay2_FixtureCheck);
//MustHaveDIList.Add(IO_Type.SidesWay2_TopCylinder_Up);
//MustHaveDIList.Add(IO_Type.SidesWay2_TopCylinder_Down);
//MustHaveDIList.Add(IO_Type.DriveMotor_INV1);
//MustHaveDIList.Add(IO_Type.DriveMotor_INV2);
//MustHaveDOList.Add(IO_Type.AutoRun_HddLed);
//MustHaveDOList.Add(IO_Type.RunSign_HddLed);
//MustHaveDOList.Add(IO_Type.Alarm_HddLed);
//MustHaveDOList.Add(IO_Type.DriveMotor_Run);
//MustHaveDOList.Add(IO_Type.SidesWay12_DriveMotor);
//MustHaveDOList.Add(IO_Type.SidesWay34_DriveMotor);
MustHaveDOList
.
Add
(
IO_Type
.
StopCylinder_Down1
);
//
MustHaveDOList.Add(IO_Type.StopCylinder_Down1);
MustHaveDOList
.
Add
(
IO_Type
.
StopCylinder_Down2
);
//
MustHaveDOList.Add(IO_Type.StopCylinder_Down2);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay1_StopCylinderDown
);
//
MustHaveDOList.Add(IO_Type.SidesWay1_StopCylinderDown);
MustHaveDOList
.
Add
(
IO_Type
.
InStore_TopCylinder_Up
);
//
MustHaveDOList.Add(IO_Type.InStore_TopCylinder_Up);
MustHaveDOList
.
Add
(
IO_Type
.
InStore_TopCylinder_Down
);
//
MustHaveDOList.Add(IO_Type.InStore_TopCylinder_Down);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay3_StopCylinderDown
);
//
MustHaveDOList.Add(IO_Type.SidesWay3_StopCylinderDown);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay34_TopCylinder_Up
);
//
MustHaveDOList.Add(IO_Type.SidesWay34_TopCylinder_Up);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay34_TopCylinder_Down
);
//
MustHaveDOList.Add(IO_Type.SidesWay34_TopCylinder_Down);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay3_StopFixtureCheck
);
//
MustHaveDIList.Add(IO_Type.SidesWay3_StopFixtureCheck);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay3_FixtureCheck
);
//
MustHaveDIList.Add(IO_Type.SidesWay3_FixtureCheck);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay3_TopCylinder_Up
);
//
MustHaveDIList.Add(IO_Type.SidesWay3_TopCylinder_Up);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay3_TopCylinder_Down
);
//
MustHaveDIList.Add(IO_Type.SidesWay3_TopCylinder_Down);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay4_FixtureCheck
);
//
MustHaveDIList.Add(IO_Type.SidesWay4_FixtureCheck);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay4_TopCylinder_Up
);
//
MustHaveDIList.Add(IO_Type.SidesWay4_TopCylinder_Up);
MustHaveDIList
.
Add
(
IO_Type
.
SidesWay4_TopCylinder_Down
);
//
MustHaveDIList.Add(IO_Type.SidesWay4_TopCylinder_Down);
MustHaveDIList
.
Add
(
IO_Type
.
OutStore_FixtureCheck
);
//
MustHaveDIList.Add(IO_Type.OutStore_FixtureCheck);
MustHaveDIList
.
Add
(
IO_Type
.
OutStore_TrayCheck
);
//
MustHaveDIList.Add(IO_Type.OutStore_TrayCheck);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay12_TopCylinder_Up
);
//
MustHaveDOList.Add(IO_Type.SidesWay12_TopCylinder_Up);
MustHaveDOList
.
Add
(
IO_Type
.
SidesWay12_TopCylinder_Down
);
//
MustHaveDOList.Add(IO_Type.SidesWay12_TopCylinder_Down);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论