Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
SO20242OutBound
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5dd81603
由
LN
编写于
2023-05-31 16:31:06 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1
1 个父辈
c0f53016
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
101 行增加
和
48 行删除
DeviceLibrary/DeviceLibrary/CodeManager.cs
DeviceLibrary/DeviceLibrary/HC/HCIOManager.cs
DeviceLibrary/theMachine/OutShelfBean.cs
DeviceLibrary/userControl/AxisMoveControl.cs
LoadCVSLibrary/Config/Config.csv
LoadCVSLibrary/position/ACSAStorePosition.cs
LoadCVSLibrary/storeConfig/config/DeviceConfig.cs
TheMachine/AxisControl.Designer.cs
TheMachine/FormMain.cs
TheMachine/UC/ConfigControl.cs
TheMachine/UC/StorePosControl.cs
DeviceLibrary/DeviceLibrary/CodeManager.cs
查看文件 @
5dd8160
...
...
@@ -173,12 +173,13 @@ namespace DeviceLibrary
[
HandleProcessCorruptedStateExceptions
]
public
static
List
<
CodeInfo
>
CameraScan
(
List
<
string
>
cameraNameList
)
{
{
HashSet
<
string
>
codestr
=
new
HashSet
<
string
>();
List
<
CodeInfo
>
codeList
=
new
List
<
CodeInfo
>();
string
bitmapfilename
=
""
;
if
(
cameraNameList
==
null
||
cameraNameList
.
Count
<=
0
)
{
return
codeList
;
throw
new
Exception
(
"CameraScan方法没有传入相机名称."
);
}
...
...
DeviceLibrary/DeviceLibrary/HC/HCIOManager.cs
查看文件 @
5dd8160
...
...
@@ -37,7 +37,7 @@ namespace OnlineStore.DeviceLibrary.IO
return
HCBoardManager
.
OpenCard
();
}
}
return
fals
e
;
return
tru
e
;
}
public
IO_VALUE
GetDIValue
(
string
deviceName
,
byte
slaveID
,
ushort
index
)
...
...
DeviceLibrary/theMachine/OutShelfBean.cs
查看文件 @
5dd8160
...
...
@@ -107,6 +107,10 @@ namespace DeviceLibrary
}
public
bool
ShelfValid
()
{
if
(
CurrShelf
==
null
)
{
return
false
;
}
//料架是否有效可放料
if
(
CurrShelf
.
realRFID
!=
""
&&
CurrShelf
.
IsNeedLeave
==
false
)
{
...
...
DeviceLibrary/userControl/AxisMoveControl.cs
查看文件 @
5dd8160
...
...
@@ -28,7 +28,10 @@ namespace DeviceLibrary
InitializeComponent
();
crc
.
OpenResourceLog
=
true
;
crc
.
LanguageChangeEvent
+=
Crc_LanguageChangeEvent
;
crc
.
CurrLanguage
=
Setting_Init
.
Device_Default_Language
;
if
(
Setting_Init
.
Device_Default_Language
!=
null
)
{
crc
.
CurrLanguage
=
Setting_Init
.
Device_Default_Language
;
}
}
private
void
Crc_LanguageChangeEvent
(
object
sender
,
EventArgs
e
)
...
...
@@ -38,6 +41,10 @@ namespace DeviceLibrary
public
void
LoadData
(
List
<
AxisBean
>
axisList
,
bool
isHc
=
true
)
{
if
(
axisList
==
null
)
{
return
;
}
//this.boxBean = equipBase;
this
.
axisList
=
axisList
;
//axisList = new List<ConfigMoveAxis>(equipBase.Config.moveAxisList);
...
...
LoadCVSLibrary/Config/Config.csv
查看文件 @
5dd8160
...
...
@@ -66,15 +66,15 @@ DO,0,出料口4定位下降,U4_Location_Down,20,HC,Y20,,,,,,,,,,
PRO,50,IO信号超时时间(秒),IOSingle_TimerOut,5,,,,,,,,,,,,
PRO,0,气压检测超时,AirCheckSeconds,5,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,1
5
,旋转轴待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
PRO,1
0
,旋转轴待机点P1,Middle_P1,168460,,,50000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,1
6
,升降轴待机点P1,UpDown_P1,1006626,,,500000,,,,,,,,,
PRO,1
1
,升降轴待机点P1,UpDown_P1,1006626,,,500000,,,,,,,,,
,16,升降轴每毫米脉冲,UpDown_PoToMM,1000,,,,,,,,,,,,
PRO,1
6
,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
PRO,1
1
,升降轴低速,UpDown_S1_Speed,1006626,,,,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,1
7
,进出轴待机点P1,InOut_P1,0,,,500000,,,,,,,,,
PRO,1
2
,进出轴待机点P1,InOut_P1,0,,,500000,,,,,,,,,
,,,,,,,,,,,,,,,,
PRO,1
8
,压紧轴待机点P1,Comp_P1,0,,,500000,,,,,,,,,
PRO,1
8
,压紧轴8mm压紧点P2,Comp_P2,0,,,500000,,,,,,,,,
PRO,1
8
,压紧轴库位高点偏移毫米,Comp_PH_MM,10,,,,,,,,,,,,
PRO,
18
,压紧轴每毫米脉冲,Comp_PoToMM,1000,,,,,,,,,,,,
PRO,1
3
,压紧轴待机点P1,Comp_P1,0,,,500000,,,,,,,,,
PRO,1
3
,压紧轴8mm压紧点P2,Comp_P2,0,,,500000,,,,,,,,,
PRO,1
3
,压紧轴库位高点偏移毫米,Comp_PH_MM,10,,,,,,,,,,,,
PRO,
50
,压紧轴每毫米脉冲,Comp_PoToMM,1000,,,,,,,,,,,,
LoadCVSLibrary/position/ACSAStorePosition.cs
查看文件 @
5dd8160
...
...
@@ -16,23 +16,23 @@ namespace OnlineStore.LoadCSVLibrary
/// <summary>
/// 中轴位置(旋转轴库位点)P2
/// </summary>
[
CSVAttribute
(
"旋转轴位置P2"
),
Editable
(
"
Middle_Axis
"
)]
[
CSVAttribute
(
"旋转轴位置P2"
),
Editable
(
"
0
"
)]
public
int
XAxis_Position_P2
{
get
;
set
;
}
/// <summary>
/// 升降轴(库位入料前点)P3
/// </summary>
[
CSVAttribute
(
"升降轴库位入料高点P3"
),
Editable
(
"
UpDown_Axis
"
)]
[
CSVAttribute
(
"升降轴库位入料高点P3"
),
Editable
(
"
1
"
)]
public
int
UpDownAxis_IHPosition_P3
{
get
;
set
;
}
/// <summary>
/// 升降轴(库位入料缓冲点)P4
/// </summary>
[
CSVAttribute
(
"升降轴库位入料低点P4"
),
Editable
(
"
UpDown_Axis
"
)]
[
CSVAttribute
(
"升降轴库位入料低点P4"
),
Editable
(
"
1
"
)]
public
int
UpDownAxis_ILPosition_P4
{
get
;
set
;
}
/// <summary>
/// 进出轴(库位点取料点)P3
/// </summary>
[
CSVAttribute
(
"进出轴库位点取料点P3"
),
Editable
(
"
InOut_Axis
"
)]
[
CSVAttribute
(
"进出轴库位点取料点P3"
),
Editable
(
"
2
"
)]
public
int
InOutAxis_Position_P3
{
get
;
set
;
}
/// <summary>
/// 备注
...
...
LoadCVSLibrary/storeConfig/config/DeviceConfig.cs
查看文件 @
5dd8160
...
...
@@ -31,6 +31,14 @@ namespace OnlineStore.LoadCSVLibrary
public
static
Dictionary
<
String
,
ConfigIO
>
AllDOlist
{
get
;
set
;
}
public
static
Dictionary
<
String
,
ConfigIO
>
AllDOEleclist
{
get
;
set
;
}
public
void
clearList
()
{
this
.
DIList
.
Clear
();
this
.
DOList
.
Clear
();
this
.
moveAxisList
.
Clear
();
this
.
configList
.
Clear
();
}
public
DeviceConfig
()
{
...
...
@@ -259,7 +267,6 @@ namespace OnlineStore.LoadCSVLibrary
}
return
null
;
}
}
public
class
DeviceType
{
...
...
TheMachine/AxisControl.Designer.cs
查看文件 @
5dd8160
...
...
@@ -60,7 +60,7 @@ namespace TheMachine
this
.
configControl1
.
Location
=
new
System
.
Drawing
.
Point
(
568
,
3
);
this
.
configControl1
.
Margin
=
new
System
.
Windows
.
Forms
.
Padding
(
4
,
4
,
4
,
4
);
this
.
configControl1
.
Name
=
"configControl1"
;
this
.
configControl1
.
Size
=
new
System
.
Drawing
.
Size
(
647
,
627
);
this
.
configControl1
.
Size
=
new
System
.
Drawing
.
Size
(
647
,
550
);
this
.
configControl1
.
TabIndex
=
1
;
this
.
configControl1
.
Tag
=
"not"
;
//
...
...
TheMachine/FormMain.cs
查看文件 @
5dd8160
...
...
@@ -370,8 +370,9 @@ namespace TheMachine
private
void
MainMachine_ButtenEvent
(
object
sender
,
ErrInfo
e
)
{
LogUtil
.
info
(
"UI "
+
e
.
ToString
());
if
(
e
==
ErrInfo
.
RunBtn
||
e
==
ErrInfo
.
ResetBtn
)
{
if
(
e
==
ErrInfo
.
RunBtn
)
//if (e == ErrInfo.RunBtn || e == ErrInfo.ResetBtn)
{
Task
.
Run
(()
=>
{
if
(!
RobotManage
.
isRunning
)
...
...
TheMachine/UC/ConfigControl.cs
查看文件 @
5dd8160
...
...
@@ -115,7 +115,7 @@ namespace TheMachine
button
.
Anchor
=
(
AnchorStyles
)(
AnchorStyles
.
Left
|
AnchorStyles
.
Right
|
AnchorStyles
.
Top
|
AnchorStyles
.
Bottom
);
button
.
Name
=
configBase
.
ProName
;
button
.
Text
=
crc
.
GetString
(
configBase
.
ProName
,
configBase
.
Explain
);
button
.
AutoSize
=
fals
e
;
button
.
AutoSize
=
tru
e
;
button
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
button
.
ForeColor
=
color
;
tableLayoutPanel1
.
Controls
.
Add
(
button
,
c
,
r
);
...
...
@@ -229,8 +229,10 @@ namespace TheMachine
var
targetSpeed
=
int
.
Parse
(
speed
[
0
].
Text
);
var
AddSpeed
=
configMoveAxis
.
AddSpeed
>
0
?
configMoveAxis
.
AddSpeed
:
targetSpeed
*
4
;
var
DelSpeed
=
configMoveAxis
.
DelSpeed
>
0
?
configMoveAxis
.
DelSpeed
:
targetSpeed
*
4
;
LogUtil
.
info
(
$
"手动点击:{((Button)sender).Text},pos:{targetpos}"
);
AxisManager
.
AbsMove
(
""
,
configMoveAxis
.
GetAxisValue
(),
targetpos
,
targetSpeed
,
AddSpeed
,
DelSpeed
);
//, configMoveAxis.AddSpeed, configMoveAxis.DelSpeed);
LogUtil
.
info
(
$
"手动点击:{((Button)sender).Text},pos:{targetpos}"
);
AxisManager
.
AbsMove
(
""
,
configMoveAxis
.
GetAxisValue
(),
targetpos
,
targetSpeed
,
AddSpeed
,
DelSpeed
);
//, configMoveAxis.AddSpeed, configMoveAxis.DelSpeed);
}
AxisBean
getConfigMoveAxis
(
int
Axisid
)
...
...
@@ -284,9 +286,11 @@ namespace TheMachine
pi
.
SetValue
(
Config
,
textBox
.
Text
);
}
}
CSVConfigReader
.
SaveConfig
(
Config
.
ConfigFilePath
,
Config
);
CSVConfigReader
.
SaveConfig
(
Config
.
ConfigFilePath
,
Config
);
Config
.
DIList
.
Clear
();
Config
.
DOList
.
Clear
();
Config
.
moveAxisList
.
Clear
();
Config
.
configList
.
Clear
();
Config
=
(
Robot_Config
)
CSVConfigReader
.
LoadConfig
(
Config
);
}
}
...
...
TheMachine/UC/StorePosControl.cs
查看文件 @
5dd8160
using
DeviceLibrary
;
using
OnlineStore.Common
;
using
OnlineStore.LoadCSVLibrary
;
using
System
;
using
System.Collections.Generic
;
...
...
@@ -187,7 +188,8 @@ namespace TheMachine
var
cc
=
tableLayoutPanel1
.
Controls
.
Find
(((
Button
)
sender
).
Name
,
false
);
var
speed
=
tableLayoutPanel1
.
Controls
.
Find
(((
Button
)
sender
).
Name
+
"_speed"
,
false
);
var
axis
=
getConfigMoveAxis
((
int
)((
Button
)
sender
).
Tag
);
string
tag
=(
string
)
((
Button
)
sender
).
Tag
;
var
axis
=
getConfigMoveAxisByname
(
tag
);
ConfigMoveAxis
configMoveAxis
=
axis
.
Config
;
var
targetpos
=
int
.
Parse
(
cc
[
1
].
Text
);
if
(!
axis
.
IsSafe
(
targetpos
,
out
string
msg
))
...
...
@@ -199,6 +201,7 @@ namespace TheMachine
var
AddSpeed
=
configMoveAxis
.
AddSpeed
>
0
?
configMoveAxis
.
AddSpeed
:
targetSpeed
*
4
;
var
DelSpeed
=
configMoveAxis
.
DelSpeed
>
0
?
configMoveAxis
.
DelSpeed
:
targetSpeed
*
4
;
AxisManager
.
AbsMove
(
""
,
configMoveAxis
.
GetAxisValue
(),
int
.
Parse
(
cc
[
1
].
Text
),
targetSpeed
,
AddSpeed
,
DelSpeed
);
//, configMoveAxis.AddSpeed, configMoveAxis.DelSpeed);
LogUtil
.
info
(
"Button_Click "
+
configMoveAxis
.
GetNameStr
()+
"【"
+
configMoveAxis
.
GetAxisValue
()
+
"】 【"
+
int
.
Parse
(
cc
[
1
].
Text
)
+
"】 【"
+
targetSpeed
+
"】 "
);
}
void
setAxisPopup
(
Control
c
,
string
title
,
ConfigMoveAxis
configMoveAxis
)
{
...
...
@@ -227,15 +230,24 @@ namespace TheMachine
{
//foreach (ConfigMoveAxis configMoveAxis in Config.moveAxisList)
//{
// if (configMoveAxis.GetAxisValue() == Axisid)
// if (configMoveAxis.GetAxisValue()
.ToString()
== Axisid)
// return configMoveAxis;
//}
foreach
(
AxisBean
configMoveAxis
in
AxisBean
.
List
)
{
{
if
(
configMoveAxis
.
Config
.
ProName
==
Axisid
)
return
configMoveAxis
;
}
return
null
;
foreach
(
AxisBean
configMoveAxis
in
AxisBean
.
List
)
{
if
(
configMoveAxis
.
Config
.
GetAxisValue
().
ToString
()
==
Axisid
)
{
return
configMoveAxis
;
}
}
return
null
;
}
private
void
ConfigControl_Load
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -250,33 +262,50 @@ namespace TheMachine
private
void
btnSavePos_Click
(
object
sender
,
EventArgs
e
)
{
for
(
int
i
=
0
;
i
<
tableLayoutPanel1
.
Controls
.
Count
;
i
++)
try
{
if
(
tableLayoutPanel1
.
Controls
[
i
].
GetType
().
Name
!=
"TextBox"
)
continue
;
TextBox
textBox
=
(
TextBox
)
tableLayoutPanel1
.
Controls
[
i
];
PropertyInfo
pi
=
_aCStorePosition
.
GetType
().
GetProperty
(
textBox
.
Name
);
if
(
pi
!=
null
)
for
(
int
i
=
0
;
i
<
tableLayoutPanel1
.
Controls
.
Count
;
i
++)
{
//var cc = Config.configList.Find(new Predicate<ConfigBase>((c) => { return c.ProName == textBox.Name; }));
//if (cc != null)
// cc.ProValue = textBox.Text;
if
(
pi
.
PropertyType
.
Name
==
"Int32"
)
pi
.
SetValue
(
_aCStorePosition
,
int
.
Parse
(
textBox
.
Text
));
else
if
(
pi
.
PropertyType
.
Name
==
"Double"
)
pi
.
SetValue
(
_aCStorePosition
,
double
.
Parse
(
textBox
.
Text
));
else
pi
.
SetValue
(
_aCStorePosition
,
textBox
.
Text
);
if
(
tableLayoutPanel1
.
Controls
[
i
].
GetType
().
Name
!=
"TextBox"
)
continue
;
TextBox
textBox
=
(
TextBox
)
tableLayoutPanel1
.
Controls
[
i
];
PropertyInfo
pi
=
_aCStorePosition
.
GetType
().
GetProperty
(
textBox
.
Name
);
if
(
pi
!=
null
)
{
//var cc = Config.configList.Find(new Predicate<ConfigBase>((c) => { return c.ProName == textBox.Name; }));
//if (cc != null)
// cc.ProValue = textBox.Text;
if
(
pi
.
PropertyType
.
Name
==
"Int32"
)
pi
.
SetValue
(
_aCStorePosition
,
int
.
Parse
(
textBox
.
Text
));
else
if
(
pi
.
PropertyType
.
Name
==
"Double"
)
pi
.
SetValue
(
_aCStorePosition
,
double
.
Parse
(
textBox
.
Text
));
else
pi
.
SetValue
(
_aCStorePosition
,
textBox
.
Text
);
}
}
}
var
positionConfigFile
=
Path
.
Combine
(
Application
.
StartupPath
,
"config\\Magzine.csv"
);
var
positionConfigFile1
=
Path
.
Combine
(
Application
.
StartupPath
,
"config\\Orther.csv"
);
var
positionConfigFile
=
Path
.
Combine
(
Application
.
StartupPath
,
"StoreConfig\\linePositions.csv"
);
var
positionConfigFile1
=
Path
.
Combine
(
Application
.
StartupPath
,
"StoreConfig\\fixPositions.csv"
);
bool
result
=
CSVPositionReader
<
ACStorePosition
>.
SavePostion
(
positionConfigFile
,
_aCStorePosition
);
result
=
CSVPositionReader
<
ACStorePosition
>.
SavePostion
(
positionConfigFile1
,
_aCStorePosition
);
if
(
result
)
{
MessageBox
.
Show
(
"保存成功!"
);
}
else
{
bool
result
=
CSVPositionReader
<
ACStorePosition
>.
SavePostion
(
positionConfigFile
,
_aCStorePosition
);
result
=
CSVPositionReader
<
ACStorePosition
>.
SavePostion
(
positionConfigFile1
,
_aCStorePosition
);
MessageBox
.
Show
(
"保存失败!"
);
}
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"保存失败:"
+
ex
.
ToString
());
MessageBox
.
Show
(
"保存失败!"
+
ex
.
ToString
());
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论