Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d18889ef
由
LN
编写于
2021-04-29 13:59:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
调宽速度bug修改。界面状态显示修改。
1 个父辈
2dbc2422
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
151 行增加
和
109 行删除
DeviceLibrary/manager/ResourceControl.cs
DeviceLibrary/manager/TSAVBean.cs
PUSICANLibrary/PUSICANControl.cs
TSA-V/App.config
TSA-V/FrmMaintenance.cs
TSA-V/FrmMenu.Designer.cs
TSA-V/FrmMenu.cs
TSA-V/deviceDebug/FrmPusicanTest.cs
TSA-V/workForm/FrmTSAV.cs
DeviceLibrary/manager/ResourceControl.cs
查看文件 @
d18889e
...
@@ -97,5 +97,30 @@ namespace TSA_V
...
@@ -97,5 +97,30 @@ namespace TSA_V
/// IO模块连接失败
/// IO模块连接失败
/// </summary>
/// </summary>
public
static
string
IOConnectError
=
"IOConnectError"
;
public
static
string
IOConnectError
=
"IOConnectError"
;
/// <summary>
/// 设备急停中
/// </summary>
public
static
string
DeviceInSuddenStop
=
"DeviceInSuddenStop"
;
/// <summary>
/// 设备未启动
/// </summary>
public
static
string
DeviceNotStart
=
"DeviceNotStart"
;
/// <summary>
/// 设备正在原点返回中
/// </summary>
public
static
string
DeviceInGohome
=
"DeviceInGohome"
;
/// <summary>
/// 设备工作中
/// </summary>
public
static
string
DeviceInWork
=
"DeviceInWork"
;
/// <summary>
/// 流水线转动中
/// </summary>
public
static
string
LineTurn
=
"LineTurn"
;
/// <summary>
/// 已工作{0},{1}块电路板
/// </summary>
public
static
string
WorkInfoMsg
=
"WorkInfoMsg"
;
}
}
}
}
DeviceLibrary/manager/TSAVBean.cs
查看文件 @
d18889e
...
@@ -130,7 +130,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -130,7 +130,7 @@ namespace TSA_V.DeviceLibrary
if
(!
msg
.
Equals
(
""
))
if
(!
msg
.
Equals
(
""
))
{
{
LogUtil
.
error
(
Name
+
"Can协议连接失败:"
+
msg
);
LogUtil
.
error
(
Name
+
"Can协议连接失败:"
+
msg
);
return
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
return
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
}
}
else
else
{
{
...
@@ -187,9 +187,9 @@ namespace TSA_V.DeviceLibrary
...
@@ -187,9 +187,9 @@ namespace TSA_V.DeviceLibrary
}
}
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
public
static
event
ShowPointDelegate
ShowPointEvent
;
public
static
event
ShowPointDelegate
ShowPointEvent
;
public
static
void
ShowPoint
(
double
x
,
double
y
,
int
type
=
1
,
int
sizex
=
1
,
int
sizey
=
1
,
int
penWidth
=
2
,
string
name
=
""
)
public
static
void
ShowPoint
(
double
x
,
double
y
,
int
type
=
1
,
int
sizex
=
1
,
int
sizey
=
1
,
int
penWidth
=
2
,
string
name
=
""
)
{
{
ProjectorPInfo
p
=
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
sizex
,
sizey
,
penWidth
,
name
);
ProjectorPInfo
p
=
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
sizex
,
sizey
,
penWidth
,
name
);
ShowPointEvent
?.
Invoke
(
p
);
ShowPointEvent
?.
Invoke
(
p
);
}
}
/// <summary>
/// <summary>
...
@@ -249,7 +249,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -249,7 +249,7 @@ namespace TSA_V.DeviceLibrary
Thread
.
Sleep
(
10
);
Thread
.
Sleep
(
10
);
}
}
}
}
PUSICANControl
.
InitRNodeConfig
(
LWidthManager
.
Line_NodeAddr
,
true
);
PUSICANControl
.
InitRNodeConfig
(
LWidthManager
.
Line_NodeAddr
,
true
);
Thread
.
Sleep
(
10
);
Thread
.
Sleep
(
10
);
//所有轴原点返回
//所有轴原点返回
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
...
@@ -517,7 +517,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -517,7 +517,7 @@ namespace TSA_V.DeviceLibrary
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
if
(
PUSICANControl
.
IsDuZhuan
(
node
.
NodeId
))
if
(
PUSICANControl
.
IsDuZhuan
(
node
.
NodeId
))
{
{
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
DuZhuanMsg
,
" 旋转轴[{0}]堵转,需要重置"
,
node
.
NodeId
);
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
DuZhuanMsg
,
" 旋转轴[{0}]堵转,需要重置"
,
node
.
NodeId
);
LogUtil
.
error
(
Name
+
" "
+
WarnMsg
);
LogUtil
.
error
(
Name
+
" "
+
WarnMsg
);
return
;
return
;
}
}
...
@@ -525,14 +525,14 @@ namespace TSA_V.DeviceLibrary
...
@@ -525,14 +525,14 @@ namespace TSA_V.DeviceLibrary
}
}
}
}
}
}
public
static
bool
NextPoint
(
bool
isNext
,
bool
isResetBoard
)
public
static
bool
NextPoint
(
bool
isNext
,
bool
isResetBoard
)
{
{
if
(
Status
.
Equals
(
TSAVStatus
.
Runing
))
if
(
Status
.
Equals
(
TSAVStatus
.
Runing
))
{
{
if
(!
Work
.
IsWorking
)
if
(!
Work
.
IsWorking
)
{
{
//StartWork(BoardManager.CurrBoard);
//StartWork(BoardManager.CurrBoard);
return
false
;
return
false
;
}
}
if
(
Work
.
IsWaitMove
)
if
(
Work
.
IsWaitMove
)
{
{
...
@@ -541,10 +541,11 @@ namespace TSA_V.DeviceLibrary
...
@@ -541,10 +541,11 @@ namespace TSA_V.DeviceLibrary
}
}
if
(!(
Work
.
IsWaitMove
))
if
(!(
Work
.
IsWaitMove
))
{
{
Work
.
MoveToNextPoint
(
isNext
,
isResetBoard
);
Work
.
MoveToNextPoint
(
isNext
,
isResetBoard
);
return
true
;
return
true
;
}
}
}
return
false
;
}
return
false
;
}
}
public
static
void
StopRun
()
public
static
void
StopRun
()
...
@@ -587,7 +588,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -587,7 +588,7 @@ namespace TSA_V.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
Work
.
LastSetpTime
;
TimeSpan
span
=
DateTime
.
Now
-
Work
.
LastSetpTime
;
List
<
WaitResultInfo
>
list
=
Work
.
waitList
;
List
<
WaitResultInfo
>
list
=
Work
.
waitList
;
string
waitMsg
=
""
;
string
waitMsg
=
""
;
bool
isOk
=
WaitResultInfo
.
GetWaitResult
(
list
,
span
,
false
,
out
waitMsg
);
bool
isOk
=
WaitResultInfo
.
GetWaitResult
(
list
,
span
,
false
,
out
waitMsg
);
if
(
isOk
)
if
(
isOk
)
{
{
Work
.
EndWait
();
Work
.
EndWait
();
...
@@ -596,7 +597,7 @@ namespace TSA_V.DeviceLibrary
...
@@ -596,7 +597,7 @@ namespace TSA_V.DeviceLibrary
{
{
if
(
span
.
TotalSeconds
>
30
)
if
(
span
.
TotalSeconds
>
30
)
{
{
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
WaitTimeOutMsg
,
"组装中,等待【{0}】超时 已等待[{1}]秒"
,
waitMsg
,
Math
.
Round
(
span
.
TotalSeconds
,
0
));
WarnMsg
=
GetTime
()
+
ResourceControl
.
GetString
(
ResourceControl
.
WaitTimeOutMsg
,
"组装中,等待【{0}】超时 已等待[{1}]秒"
,
waitMsg
,
Math
.
Round
(
span
.
TotalSeconds
,
0
));
LogUtil
.
error
(
WarnMsg
);
LogUtil
.
error
(
WarnMsg
);
}
}
}
}
...
@@ -625,6 +626,45 @@ namespace TSA_V.DeviceLibrary
...
@@ -625,6 +626,45 @@ namespace TSA_V.DeviceLibrary
}
}
return
false
;
return
false
;
}
}
public
static
string
GetShowMsg
()
{
string
ShowMsg
=
""
;
if
(
TSAVBean
.
IsInSuddenDown
)
{
ShowMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceInSuddenStop
,
"设备急停中"
);
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Wait
))
{
ShowMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceNotStart
,
"设备未启动"
);
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Reset
))
{
ShowMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceInGohome
,
"设备正在原点返回中"
);
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Runing
))
{
string
msg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceInWork
,
"设备工作中"
);
string
lineMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
LineTurn
,
"流水线转动中"
);
if
(
TSAVBean
.
Work
.
IsWorking
)
{
TimeSpan
span
=
DateTime
.
Now
-
TSAVBean
.
Work
.
beginWorkTime
;
int
count
=
TSAVBean
.
Work
.
BoardCount
;
string
time
=
span
.
Hours
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Minutes
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Seconds
.
ToString
().
PadLeft
(
2
,
'0'
);
ShowMsg
=
ResourceControl
.
GetString
(
ResourceControl
.
WorkInfoMsg
,
"已工作{0},{1}块电路板"
,
time
,
count
)
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
{
ShowMsg
=
lineMsg
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
else
{
ShowMsg
=
msg
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
}
return
ShowMsg
;
}
}
}
public
class
NodeInfo
public
class
NodeInfo
{
{
...
...
PUSICANLibrary/PUSICANControl.cs
查看文件 @
d18889e
...
@@ -711,19 +711,11 @@ namespace PUSICANLibrary
...
@@ -711,19 +711,11 @@ namespace PUSICANLibrary
//重置位置
//重置位置
SetPosition
(
nodeId
,
0
);
SetPosition
(
nodeId
,
0
);
////重置速度
//int startSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_StartSpeed, nodeId.ToString());
//PUSICANControl.SetStartSpeed(nodeId, startSpeed);
//int stopSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_StopSpeed, nodeId.ToString());
//PUSICANControl.SetStopSpeed(nodeId, stopSpeed);
//int maxSpeed = ConfigAppSettings.GetIntValue(Setting_Init.RotateNode_MaxSpeed, nodeId.ToString());
//PUSICANControl.SetMaxSpeed(nodeId, maxSpeed);
return
true
;
return
true
;
}
}
public
static
bool
SetSpeed
(
uint
nodeId
,
bool
isLineSlv
=
false
)
public
static
bool
SetSpeed
(
uint
nodeId
,
bool
isLineSlv
)
{
{
//重置速度
//重置速度
int
startSpeed
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RotateNode_StartSpeed
,
nodeId
.
ToString
());
int
startSpeed
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RotateNode_StartSpeed
,
nodeId
.
ToString
());
...
@@ -847,8 +839,7 @@ namespace PUSICANLibrary
...
@@ -847,8 +839,7 @@ namespace PUSICANLibrary
//设置为位置模式
//设置为位置模式
PUSICANControl
.
WriteSDO
(
node
,
CAN_Address
.
MoveType
,
movetype
);
PUSICANControl
.
WriteSDO
(
node
,
CAN_Address
.
MoveType
,
movetype
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
bool
isLineslv
=
node
.
Equals
(
isLineSlv
);
PUSICANControl
.
SetSpeed
(
node
,
isLineSlv
);
PUSICANControl
.
SetSpeed
(
node
);
Thread
.
Sleep
(
10
);
Thread
.
Sleep
(
10
);
//所有轴走到待机点
//所有轴走到待机点
PUSICANControl
.
AbsMove
(
node
,
targetDefaultPosition
);
PUSICANControl
.
AbsMove
(
node
,
targetDefaultPosition
);
...
...
TSA-V/App.config
查看文件 @
d18889e
...
@@ -90,12 +90,12 @@
...
@@ -90,12 +90,12 @@
<
add
key
=
"Line_HomeStartSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_HomeStartSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_HomeStopSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_HomeStopSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_MicroStepping"
value
=
"4"
/>
<
add
key
=
"Line_MicroStepping"
value
=
"4"
/>
<
add
key
=
"Line_MaxSpeed"
value
=
"
1
000"
/>
<
add
key
=
"Line_MaxSpeed"
value
=
"
2
000"
/>
<
add
key
=
"Line_StartSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_StartSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_StopSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_StopSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_AddSpeed"
value
=
"8"
/>
<
add
key
=
"Line_AddSpeed"
value
=
"8"
/>
<
add
key
=
"Line_DelSpeed"
value
=
"8"
/>
<
add
key
=
"Line_DelSpeed"
value
=
"8"
/>
<
add
key
=
"Line_MaxPhaseCurrent"
value
=
"2
0
00"
/>
<
add
key
=
"Line_MaxPhaseCurrent"
value
=
"2
2
00"
/>
<
add
key
=
"Line_DelPhaseCurrent"
value
=
"2"
/>
<
add
key
=
"Line_DelPhaseCurrent"
value
=
"2"
/>
<!--调宽配置:电机回原点后的宽度-->
<!--调宽配置:电机回原点后的宽度-->
<
add
key
=
"Line_HomeWidth"
value
=
"508"
/>
<
add
key
=
"Line_HomeWidth"
value
=
"508"
/>
...
...
TSA-V/FrmMaintenance.cs
查看文件 @
d18889e
...
@@ -31,6 +31,26 @@ namespace TSA_V
...
@@ -31,6 +31,26 @@ namespace TSA_V
private
void
btnPosition_Click
(
object
sender
,
EventArgs
e
)
private
void
btnPosition_Click
(
object
sender
,
EventArgs
e
)
{
{
string
msg
=
""
;
//复位完成才能打开
if
(
TSAVBean
.
IsInSuddenDown
)
{
msg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceInSuddenStop
,
"设备急停中"
);
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Wait
))
{
msg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceNotStart
,
"设备未启动"
);
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Reset
))
{
msg
=
ResourceControl
.
GetString
(
ResourceControl
.
DeviceInGohome
,
"设备正在原点返回中"
);
}
if
(!
String
.
IsNullOrEmpty
(
msg
))
{
MessageBox
.
Show
(
msg
);
return
;
}
FrmPusicanTest
frmCom
=
new
FrmPusicanTest
();
FrmPusicanTest
frmCom
=
new
FrmPusicanTest
();
this
.
Visible
=
false
;
this
.
Visible
=
false
;
frmCom
.
ShowDialog
();
frmCom
.
ShowDialog
();
...
...
TSA-V/FrmMenu.Designer.cs
查看文件 @
d18889e
...
@@ -36,6 +36,7 @@ namespace TSA_V
...
@@ -36,6 +36,7 @@ namespace TSA_V
this
.
btnExit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnExit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnWork
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnWork
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
lblMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnHistory
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnHistory
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
LblUserName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
LblUserName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnScreenTest
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnScreenTest
=
new
System
.
Windows
.
Forms
.
Button
();
...
@@ -58,9 +59,10 @@ namespace TSA_V
...
@@ -58,9 +59,10 @@ namespace TSA_V
//
//
this
.
lblVersion
.
AutoSize
=
true
;
this
.
lblVersion
.
AutoSize
=
true
;
this
.
lblVersion
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
lblVersion
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
lblVersion
.
Location
=
new
System
.
Drawing
.
Point
(
510
,
420
);
this
.
lblVersion
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblVersion
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
435
);
this
.
lblVersion
.
Name
=
"lblVersion"
;
this
.
lblVersion
.
Name
=
"lblVersion"
;
this
.
lblVersion
.
Size
=
new
System
.
Drawing
.
Size
(
7
7
,
12
);
this
.
lblVersion
.
Size
=
new
System
.
Drawing
.
Size
(
7
5
,
17
);
this
.
lblVersion
.
TabIndex
=
11
;
this
.
lblVersion
.
TabIndex
=
11
;
this
.
lblVersion
.
Text
=
"版本号 1.1.2"
;
this
.
lblVersion
.
Text
=
"版本号 1.1.2"
;
//
//
...
@@ -72,7 +74,7 @@ namespace TSA_V
...
@@ -72,7 +74,7 @@ namespace TSA_V
this
.
btnExit
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnExit
.
FlatStyle
=
System
.
Windows
.
Forms
.
FlatStyle
.
Flat
;
this
.
btnExit
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
14.25F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnExit
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
14.25F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
btnExit
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnExit
.
ForeColor
=
System
.
Drawing
.
Color
.
White
;
this
.
btnExit
.
Location
=
new
System
.
Drawing
.
Point
(
725
,
16
);
this
.
btnExit
.
Location
=
new
System
.
Drawing
.
Point
(
725
,
20
);
this
.
btnExit
.
Name
=
"btnExit"
;
this
.
btnExit
.
Name
=
"btnExit"
;
this
.
btnExit
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
37
);
this
.
btnExit
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
37
);
this
.
btnExit
.
TabIndex
=
9
;
this
.
btnExit
.
TabIndex
=
9
;
...
@@ -98,6 +100,7 @@ namespace TSA_V
...
@@ -98,6 +100,7 @@ namespace TSA_V
// panel1
// panel1
//
//
this
.
panel1
.
BackgroundImageLayout
=
System
.
Windows
.
Forms
.
ImageLayout
.
Stretch
;
this
.
panel1
.
BackgroundImageLayout
=
System
.
Windows
.
Forms
.
ImageLayout
.
Stretch
;
this
.
panel1
.
Controls
.
Add
(
this
.
lblMsg
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnHistory
);
this
.
panel1
.
Controls
.
Add
(
this
.
btnHistory
);
this
.
panel1
.
Controls
.
Add
(
this
.
LblUserName
);
this
.
panel1
.
Controls
.
Add
(
this
.
LblUserName
);
this
.
panel1
.
Controls
.
Add
(
this
.
lblVersion
);
this
.
panel1
.
Controls
.
Add
(
this
.
lblVersion
);
...
@@ -114,6 +117,17 @@ namespace TSA_V
...
@@ -114,6 +117,17 @@ namespace TSA_V
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
861
,
453
);
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
861
,
453
);
this
.
panel1
.
TabIndex
=
14
;
this
.
panel1
.
TabIndex
=
14
;
//
//
// lblMsg
//
this
.
lblMsg
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
lblMsg
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
lblMsg
.
Location
=
new
System
.
Drawing
.
Point
(
213
,
384
);
this
.
lblMsg
.
Name
=
"lblMsg"
;
this
.
lblMsg
.
Size
=
new
System
.
Drawing
.
Size
(
636
,
60
);
this
.
lblMsg
.
TabIndex
=
21
;
this
.
lblMsg
.
Text
=
"版本号 1.1.2"
;
this
.
lblMsg
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleCenter
;
//
// btnHistory
// btnHistory
//
//
this
.
btnHistory
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
btnHistory
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
...
@@ -134,9 +148,10 @@ namespace TSA_V
...
@@ -134,9 +148,10 @@ namespace TSA_V
//
//
this
.
LblUserName
.
AutoSize
=
true
;
this
.
LblUserName
.
AutoSize
=
true
;
this
.
LblUserName
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
LblUserName
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
this
.
LblUserName
.
Location
=
new
System
.
Drawing
.
Point
(
21
,
420
);
this
.
LblUserName
.
Font
=
new
System
.
Drawing
.
Font
(
"微软雅黑"
,
9F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
LblUserName
.
Location
=
new
System
.
Drawing
.
Point
(
615
,
32
);
this
.
LblUserName
.
Name
=
"LblUserName"
;
this
.
LblUserName
.
Name
=
"LblUserName"
;
this
.
LblUserName
.
Size
=
new
System
.
Drawing
.
Size
(
4
1
,
12
);
this
.
LblUserName
.
Size
=
new
System
.
Drawing
.
Size
(
4
3
,
17
);
this
.
LblUserName
.
TabIndex
=
18
;
this
.
LblUserName
.
TabIndex
=
18
;
this
.
LblUserName
.
Text
=
"label1"
;
this
.
LblUserName
.
Text
=
"label1"
;
//
//
...
@@ -301,5 +316,6 @@ namespace TSA_V
...
@@ -301,5 +316,6 @@ namespace TSA_V
private
System
.
Windows
.
Forms
.
Button
btnScreenTest
;
private
System
.
Windows
.
Forms
.
Button
btnScreenTest
;
private
System
.
Windows
.
Forms
.
Button
btnHistory
;
private
System
.
Windows
.
Forms
.
Button
btnHistory
;
private
System
.
Windows
.
Forms
.
Label
LblUserName
;
private
System
.
Windows
.
Forms
.
Label
LblUserName
;
private
System
.
Windows
.
Forms
.
Label
lblMsg
;
}
}
}
}
\ No newline at end of file
\ No newline at end of file
TSA-V/FrmMenu.cs
查看文件 @
d18889e
...
@@ -46,6 +46,7 @@ namespace TSA_V
...
@@ -46,6 +46,7 @@ namespace TSA_V
btnProduct
.
Visible
=
false
;
btnProduct
.
Visible
=
false
;
btnCom
.
Visible
=
false
;
btnCom
.
Visible
=
false
;
}
}
lblMsg
.
Text
=
""
;
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
//{
//{
// btnMaintenance.Visible = true;
// btnMaintenance.Visible = true;
...
@@ -293,13 +294,6 @@ namespace TSA_V
...
@@ -293,13 +294,6 @@ namespace TSA_V
private
void
btnMaintenance_Click
(
object
sender
,
EventArgs
e
)
private
void
btnMaintenance_Click
(
object
sender
,
EventArgs
e
)
{
{
//FrmPwd fw = new FrmPwd(10);
//DialogResult result = fw.ShowDialog();
//if (!result.Equals(DialogResult.OK))
//{
// LogUtil.info("点击 元器件信息,没有正确输入密码");
// return;
//}
isClick
=
true
;
isClick
=
true
;
FrmMaintenance
.
instance
.
Show
();
FrmMaintenance
.
instance
.
Show
();
this
.
Visible
=
false
;
this
.
Visible
=
false
;
...
@@ -338,6 +332,7 @@ namespace TSA_V
...
@@ -338,6 +332,7 @@ namespace TSA_V
{
{
try
try
{
{
lblMsg
.
Text
=
TSAVBean
.
GetShowMsg
();
Screen
[]
sc
=
Screen
.
AllScreens
;
Screen
[]
sc
=
Screen
.
AllScreens
;
if
((!
FrmProjectorScreen
.
instance
.
ISShow
)
&&
sc
.
Length
>
FrmProjectorScreen
.
instance
.
ScreenIndex
)
if
((!
FrmProjectorScreen
.
instance
.
ISShow
)
&&
sc
.
Length
>
FrmProjectorScreen
.
instance
.
ScreenIndex
)
{
{
...
...
TSA-V/deviceDebug/FrmPusicanTest.cs
查看文件 @
d18889e
...
@@ -55,6 +55,7 @@ namespace TSA_V
...
@@ -55,6 +55,7 @@ namespace TSA_V
FormStatus
(
false
);
FormStatus
(
false
);
}
}
SetScreen
();
SetScreen
();
cmbNode
.
SelectedIndex
=
cmbNode
.
Items
.
Count
-
1
;
}
}
private
void
FormStatus
(
bool
open
)
private
void
FormStatus
(
bool
open
)
{
{
...
...
TSA-V/workForm/FrmTSAV.cs
查看文件 @
d18889e
...
@@ -233,84 +233,15 @@ namespace TSA_V
...
@@ -233,84 +233,15 @@ namespace TSA_V
}
}
}
}
FormStatus
();
FormStatus
();
if
(
TSAVBean
.
IsInSuddenDown
)
lblMsg
.
Text
=
TSAVBean
.
GetShowMsg
();
{
lblMsg
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
DeviceInSuddenStop
,
"设备急停中"
);
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Runing
))
//btnStart.Enabled = true;
//btnGoHome.Enabled = false;
btnStartWorking
.
Enabled
=
false
;
if
(
TSAVBean
.
IsDebug
.
Equals
(
false
))
{
btnNextPoint
.
Enabled
=
false
;
btnPrePoint
.
Enabled
=
false
;
}
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Wait
))
{
string
msg
=
ResourceCulture
.
GetString
(
ResourceCulture
.
DeviceNotStart
,
"设备未启动"
);
if
(!
lblMsg
.
Text
.
Equals
(
msg
))
{
lblMsg
.
Text
=
msg
;
//btnStart.Enabled = true;
//btnGoHome.Enabled = false;
btnStartWorking
.
Enabled
=
false
;
if
(
TSAVBean
.
IsDebug
.
Equals
(
false
))
{
btnNextPoint
.
Enabled
=
false
;
btnPrePoint
.
Enabled
=
false
;
}
}
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Reset
))
{
string
msg
=
ResourceCulture
.
GetString
(
ResourceCulture
.
DeviceInGohome
,
"设备正在原点返回中"
);
if
(!
lblMsg
.
Text
.
Equals
(
msg
))
{
lblMsg
.
Text
=
msg
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
//btnStart.Enabled = false;
//btnGoHome.Enabled = true;
btnStartWorking
.
Enabled
=
false
;
if
(
TSAVBean
.
IsDebug
.
Equals
(
false
))
{
btnNextPoint
.
Enabled
=
false
;
btnPrePoint
.
Enabled
=
false
;
}
}
}
else
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Runing
))
{
{
//如果没有开始工作,自动开始工作
//如果没有开始工作,自动开始工作
if
(!
TSAVBean
.
Work
.
IsWorking
&&
btnStart
.
Enabled
)
if
(!
TSAVBean
.
Work
.
IsWorking
&&
btnStart
.
Enabled
)
{
{
btnStart_Click
(
null
,
null
);
btnStart_Click
(
null
,
null
);
}
}
string
msg
=
ResourceCulture
.
GetString
(
ResourceCulture
.
DeviceInWork
,
"设备工作中"
);
string
lineMsg
=
ResourceCulture
.
GetString
(
ResourceCulture
.
LineTurn
,
"流水线转动中"
);
if
(!
lblMsg
.
Text
.
Equals
(
msg
))
{
if
(
TSAVBean
.
Work
.
IsWorking
)
{
TimeSpan
span
=
DateTime
.
Now
-
TSAVBean
.
Work
.
beginWorkTime
;
int
count
=
TSAVBean
.
Work
.
BoardCount
;
string
time
=
span
.
Hours
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Minutes
.
ToString
().
PadLeft
(
2
,
'0'
)
+
":"
+
span
.
Seconds
.
ToString
().
PadLeft
(
2
,
'0'
);
lblMsg
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
WorkInfoMsg
,
"已工作{0},{1}块电路板"
,
time
,
count
)
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
else
if
(
TSAVBean
.
LineStep
.
moveType
.
Equals
(
1
))
{
lblMsg
.
Text
=
lineMsg
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
else
{
lblMsg
.
Text
=
msg
+
"\r\n"
+
TSAVBean
.
WarnMsg
;
}
//btnStart.Enabled = false;
//btnGoHome.Enabled = true;
btnStartWorking
.
Enabled
=
true
;
btnNextPoint
.
Enabled
=
true
;
btnPrePoint
.
Enabled
=
true
;
}
//显示图片
if
(!
preIndex
.
Equals
(
TSAVBean
.
Work
.
currIndex
)
&&
(
TSAVBean
.
Work
.
currPoint
!=
null
))
if
(!
preIndex
.
Equals
(
TSAVBean
.
Work
.
currIndex
)
&&
(
TSAVBean
.
Work
.
currPoint
!=
null
))
{
{
ShowTSAVPoint
();
ShowTSAVPoint
();
...
@@ -387,7 +318,7 @@ namespace TSA_V
...
@@ -387,7 +318,7 @@ namespace TSA_V
{
{
btnSave
.
Enabled
=
true
;
btnSave
.
Enabled
=
true
;
btnGoHome
.
Enabled
=
true
;
btnGoHome
.
Enabled
=
true
;
if
(
TSAVBean
.
Status
<=(
TSAVStatus
.
Wait
))
if
(
TSAVBean
.
Status
<=
(
TSAVStatus
.
Wait
))
{
{
btnStart
.
Visible
=
true
;
btnStart
.
Visible
=
true
;
btnGoHome
.
Visible
=
false
;
btnGoHome
.
Visible
=
false
;
...
@@ -397,6 +328,29 @@ namespace TSA_V
...
@@ -397,6 +328,29 @@ namespace TSA_V
btnStart
.
Visible
=
false
;
btnStart
.
Visible
=
false
;
btnGoHome
.
Visible
=
true
;
btnGoHome
.
Visible
=
true
;
}
}
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Runing
)&&(!
TSAVBean
.
IsInSuddenDown
))
{
//如果没有开始工作,自动开始工作
if
(!
TSAVBean
.
Work
.
IsWorking
&&
btnStart
.
Enabled
)
{
btnStart_Click
(
null
,
null
);
}
btnStartWorking
.
Enabled
=
true
;
btnNextPoint
.
Enabled
=
true
;
btnPrePoint
.
Enabled
=
true
;
}
else
{
btnStartWorking
.
Enabled
=
false
;
if
(
TSAVBean
.
IsDebug
.
Equals
(
false
))
{
btnNextPoint
.
Enabled
=
false
;
btnPrePoint
.
Enabled
=
false
;
}
}
}
}
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
private
void
btnStart_Click
(
object
sender
,
EventArgs
e
)
{
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论