Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 05e479bd
由
LN
编写于
2023-11-10 13:35:04 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
标签库位单独配置。无转盘位置时转盘轴不需要复位。
1 个父辈
2a9e27b4
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
94 行增加
和
23 行删除
Common/Setting_Init.cs
DeviceLibrary/csvLoad/position/CSVPositionReader.cs
DeviceLibrary/manager/TSAVBean.cs
DeviceLibrary/manager/WorkModeUtil.cs
TSA-V/App.config
TSA-V/FrmMenu.cs
TSA-V/记录.txt
Common/Setting_Init.cs
查看文件 @
05e479b
...
...
@@ -21,6 +21,7 @@ namespace TSA_V.Common
public
static
string
App_Title
=
"App_Title"
;
public
static
string
Board_ConfigPath
=
"Board_ConfigPath"
;
public
static
string
Position_Config
=
"Position_Config"
;
public
static
string
Position_Config_Label
=
"Position_Config_Label"
;
public
static
string
ComPath_Config
=
"ComPath_Config"
;
/// <summary>
...
...
DeviceLibrary/csvLoad/position/CSVPositionReader.cs
查看文件 @
05e479b
...
...
@@ -175,6 +175,15 @@ namespace TSA_V.LoadCSVLibrary
string
filePath
=
appPath
+
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Position_Config
);
return
filePath
;
}
public
static
string
getLabelPositionFilePath
()
{
string
p
=
ConfigAppSettings
.
GetValue
(
Setting_Init
.
Position_Config_Label
);
if
(
p
!=
""
)
{
return
Path
.
Combine
(
Application
.
StartupPath
+
p
);
}
return
""
;
}
public
static
bool
SavePostion
(
List
<
T
>
positionList
)
{
string
filePath
=
getPositionFilePath
();
...
...
@@ -241,10 +250,19 @@ namespace TSA_V.LoadCSVLibrary
}
return
newStr
;
}
public
static
void
LoadFile
(
string
filePath
)
public
static
void
LoadFile
(
params
string
[]
filePath
)
{
//string filePath = getPositionFilePath();
AddCSVFile
(
filePath
);
foreach
(
string
str
in
filePath
)
{
if
(!
File
.
Exists
(
str
))
{
LOGGER
.
Error
(
"文件"
+
filePath
+
"不存在,跳过加载"
);
continue
;
}
AddCSVFile
(
str
);
}
}
public
static
T
GetPositonByNum
(
string
positionNum
)
...
...
DeviceLibrary/manager/TSAVBean.cs
查看文件 @
05e479b
...
...
@@ -152,18 +152,25 @@ namespace TSA_V.DeviceLibrary
MesUtil
.
Open
();
if
(
Status
.
Equals
(
TSAVStatus
.
Wait
))
{
LogUtil
.
debug
(
Name
+
" StartRun:开始连接Can协议"
);
string
msg
=
PUSICANControl
.
Open
();
if
(!
msg
.
Equals
(
""
))
{
LogUtil
.
error
(
Name
+
" StartRun 失败:Can协议连接失败:"
+
msg
);
startRunMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
warnMsg
=
startRunMsg
;
return
startRunMsg
;
}
else
if
(
WorkModeUtil
.
HasZhuanPan
||
((!
IOBase
.
NoLine
)))
{
LogUtil
.
info
(
Name
+
" StartRun:连接Can协议成功"
);
LogUtil
.
debug
(
Name
+
" StartRun:开始连接Can协议"
);
string
msg
=
PUSICANControl
.
Open
();
if
(!
msg
.
Equals
(
""
))
{
LogUtil
.
error
(
Name
+
" StartRun 失败:Can协议连接失败:"
+
msg
);
if
(
WorkModeUtil
.
HasZhuanPan
)
{
startRunMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
warnMsg
=
startRunMsg
;
return
startRunMsg
;
}
}
else
{
LogUtil
.
info
(
Name
+
" StartRun:连接Can协议成功"
);
}
}
Thread
.
Sleep
(
PUSICANControl
.
SleepMS
);
resetStep
=
ResetStep
.
OpenCan_0
;
...
...
@@ -188,6 +195,19 @@ namespace TSA_V.DeviceLibrary
{
try
{
//如果无转盘无线体,不需要加载
//有线体无转盘,不需要选择
List
<
TSAVPosition
>
allPos
=
CSVPositionReader
<
TSAVPosition
>.
getPositionList
();
List
<
TSAVPosition
>
zhuanPos
=(
from
m
in
allPos
where
m
.
PositionType
.
Equals
(
1
)
select
m
).
ToList
();
WorkModeUtil
.
HasZhuanPan
=
zhuanPos
.
Count
>
0
;
if
(!
WorkModeUtil
.
HasZhuanPan
)
{
LogUtil
.
info
(
Name
+
" DeviceCheck 未配置转盘,默认进入过板模式"
);
WorkModeUtil
.
AutoSelect
(
Name
);
return
;
}
//验证旋转轴是否上线,未上线弹出提示
LogUtil
.
info
(
Name
+
" DeviceCheck 开始连接Can协议"
);
string
msg
=
PUSICANControl
.
Open
();
...
...
@@ -591,17 +611,29 @@ namespace TSA_V.DeviceLibrary
if
(
Work
.
WorkType
>
0
)
{
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
AutoResetMsg
,
"急停恢复,自动重置设备"
);
LogUtil
.
error
(
"急停恢复,自动重置设备, 开始连接can协议"
);
string
msg
=
PUSICANControl
.
Open
();
if
(
!
msg
.
Equals
(
""
))
if
(
WorkModeUtil
.
HasZhuanPan
||
(!
IOBase
.
NoLine
))
{
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
AutoResetMsg
,
"急停恢复,自动重置设备"
)
+
" "
+
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
LogUtil
.
error
(
Name
+
"急停恢复,自动重置设备,设备连接失败:"
+
msg
);
LogUtil
.
error
(
"急停恢复,自动重置设备, 开始连接can协议"
);
string
msg
=
PUSICANControl
.
Open
();
if
(!
msg
.
Equals
(
""
))
{
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
AutoResetMsg
,
"急停恢复,自动重置设备"
)
+
" "
+
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
LogUtil
.
error
(
Name
+
"急停恢复,自动重置设备,设备连接失败:"
+
msg
);
}
else
{
LogUtil
.
info
(
Name
+
"连接Can协议成功"
);
IsInSuddenDown
=
false
;
StartReset
();
}
}
else
{
LogUtil
.
info
(
Name
+
"连接Can协议成功
"
);
LogUtil
.
error
(
"急停恢复,自动重置设备 , 无转盘,无线体,不需要连接Can协议
"
);
IsInSuddenDown
=
false
;
StartReset
();
}
...
...
DeviceLibrary/manager/WorkModeUtil.cs
查看文件 @
05e479b
...
...
@@ -19,7 +19,8 @@ namespace TSA_V.DeviceLibrary
/// <summary>
/// 只能进入过板模式
/// </summary>
public
static
bool
OnlyGuoBan
=
false
;
public
static
bool
OnlyGuoBan
=
false
;
public
static
bool
HasZhuanPan
=
true
;
private
static
bool
IsSelected
=
false
;
...
...
@@ -35,7 +36,18 @@ namespace TSA_V.DeviceLibrary
{
WorkModeUtil
.
checkModeEndEvent
?.
Invoke
();
}
internal
static
void
AutoSelect
(
string
Name
)
{
//自动设置为过板模式
if
(
IsSelected
)
{
return
;
}
IsSelected
=
true
;
LogUtil
.
error
(
Name
+
" 默认进入过板模式,不加载转盘"
);
ModeCheckEnd
();
}
internal
static
void
SelectMode
(
string
Name
)
{
if
(
IsSelected
)
...
...
TSA-V/App.config
查看文件 @
05e479b
...
...
@@ -31,6 +31,8 @@
<
add
key
=
"BOARD_IMAGE_DEFAULT"
value
=
"defaultBoard.jpg"
/>
<!--料格位置配置-->
<
add
key
=
"Position_Config"
value
=
"\config\Positions.csv"
/>
<!--其他位置配置电子屏标签-->
<
add
key
=
"Position_Config_Label"
value
=
"\config\LabelPositions.csv"
/>
<!--使用
AIO
的
IO
模块
0
=康耐得
1
=零点
...
...
TSA-V/FrmMenu.cs
查看文件 @
05e479b
...
...
@@ -125,7 +125,7 @@ namespace TSA_V
WorkCountManager
.
LoadData
();
string
positionFileName
=
CSVPositionReader
<
TSAVPosition
>.
getPositionFilePath
();
//加载位置
LoadCSVLibrary
.
CSVPositionReader
<
TSAVPosition
>.
LoadFile
(
positionFileName
);
LoadCSVLibrary
.
CSVPositionReader
<
TSAVPosition
>.
LoadFile
(
positionFileName
,
CSVPositionReader
<
TSAVPosition
>.
getLabelPositionFilePath
()
);
CSVBomManager
.
LoadAllCom
();
//加载设备信息
TSAVBean
.
LoadTSAV
();
...
...
TSA-V/记录.txt
查看文件 @
05e479b
...
...
@@ -18,6 +18,12 @@
1.AOI检测过程中,投影全黑。(到aoi步骤或者点击AOI检测按钮)
2.判断库位中没有转盘位置时不需要加载轴。
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论