Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
李娜
/
Line-Smart-Workstation
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d18889ef
由
LN
编写于
2021-04-29 13:59:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
调宽速度bug修改。界面状态显示修改。
1 个父辈
2dbc2422
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
194 行增加
和
152 行删除
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
/// IO模块连接失败
/// </summary>
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
...
...
@@ -12,11 +12,11 @@ using TSA_V.LoadCSVLibrary;
namespace
TSA_V.DeviceLibrary
{
public
partial
class
TSAVBean
{
public
partial
class
TSAVBean
{
public
static
bool
IsDebug
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsDebug
);
public
static
string
Name
=
"MASCOT"
;
public
static
int
RotateNode_DefaultPosition
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RotateNode_DefaultPosition
);
public
static
string
Name
=
"MASCOT"
;
public
static
int
RotateNode_DefaultPosition
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
RotateNode_DefaultPosition
);
public
static
Dictionary
<
int
,
Dictionary
<
int
,
NodeInfo
>>
RotateMap
=
new
Dictionary
<
int
,
Dictionary
<
int
,
NodeInfo
>>();
public
static
int
DefaultPType
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
DefaultPointType
);
...
...
@@ -36,20 +36,20 @@ namespace TSA_V.DeviceLibrary
}
public
static
bool
IsInPut
=
false
;
public
static
bool
IsInSuddenDown
=
false
;
/// <summary>
/// 工作模式,0=脚踏模式,1=自动模式
/// </summary>
public
static
int
WorkMode
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
WorkMode
);
public
static
int
AuToModeSeconds
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
AuToModeSeconds
);
public
static
TSAVStatus
Status
=
TSAVStatus
.
Wait
;
public
static
ResetStep
resetStep
=
ResetStep
.
OpenCan_0
;
public
static
DateTime
LastResetChangeTime
=
DateTime
.
Now
;
private
static
System
.
Timers
.
Timer
workTimer
=
null
;
public
static
WorkInfo
Work
=
new
WorkInfo
();
public
static
bool
IsNeedAOI
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsNeedAOI
);
public
static
bool
IsNeedAOI
=
ConfigAppSettings
.
GetBoolValue
(
Setting_Init
.
IsNeedAOI
);
public
static
bool
IsCanStepMove
=
false
;
public
static
int
LastStepIndex
=
4
;
...
...
@@ -74,7 +74,7 @@ namespace TSA_V.DeviceLibrary
workTimer
.
Interval
=
300
;
workTimer
.
Elapsed
+=
workTimer_Elapsed
;
}
int
count
=
ConfigAppSettings
.
GetIntValue
(
Setting_Init
.
TSAV_Storage_Count
);
RotateMap
=
new
Dictionary
<
int
,
Dictionary
<
int
,
NodeInfo
>>();
int
ceng
=
5
;
...
...
@@ -114,7 +114,7 @@ namespace TSA_V.DeviceLibrary
return
""
;
}
public
static
string
GetTime
()
{
string
date
=
DateTime
.
Now
.
ToString
(
"HH:mm"
);
...
...
@@ -130,7 +130,7 @@ namespace TSA_V.DeviceLibrary
if
(!
msg
.
Equals
(
""
))
{
LogUtil
.
error
(
Name
+
"Can协议连接失败:"
+
msg
);
return
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
return
ResourceControl
.
GetString
(
ResourceControl
.
CanConnectFail
,
"Can协议连接失败"
);
}
else
{
...
...
@@ -145,7 +145,7 @@ namespace TSA_V.DeviceLibrary
{
LogUtil
.
info
(
Name
+
"IO模块连接失败"
);
return
ResourceControl
.
GetString
(
ResourceControl
.
IOConnectError
,
"IO模块连接失败"
);
}
}
StartReset
();
//启动定时器
...
...
@@ -161,19 +161,19 @@ namespace TSA_V.DeviceLibrary
StopMove
();
Thread
.
Sleep
(
100
);
}
WarnMsg
=
""
;
IsInSuddenDown
=
false
;
IOManager
.
IOMove
(
IOManager
.
Line_FStart
,
IO_VALUE
.
LOW
);
LogUtil
.
info
(
Name
+
"开始重置设备"
);
LogUtil
.
info
(
Name
+
"开始重置设备"
);
LastResetChangeTime
=
DateTime
.
Now
;
Status
=
TSAVStatus
.
Reset
;
resetStep
=
ResetStep
.
AddNode_1
;
Thread
.
Sleep
(
100
);
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
{
...
...
@@ -185,12 +185,12 @@ namespace TSA_V.DeviceLibrary
PUSICANControl
.
InitNode
(
LWidthManager
.
Line_NodeAddr
);
LogUtil
.
info
(
Name
+
"重置中AddNode_1:InitNode 所有节点 "
);
}
public
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
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
delegate
bool
ShowPointDelegate
(
ProjectorPInfo
p
);
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
=
""
)
{
ProjectorPInfo
p
=
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
sizex
,
sizey
,
penWidth
,
name
);
ShowPointEvent
?.
Invoke
(
p
);
ProjectorPInfo
p
=
new
ProjectorPInfo
((
int
)
x
,
(
int
)
y
,
type
,
sizex
,
sizey
,
penWidth
,
name
);
ShowPointEvent
?.
Invoke
(
p
);
}
/// <summary>
/// 重置处理中
...
...
@@ -249,7 +249,7 @@ namespace TSA_V.DeviceLibrary
Thread
.
Sleep
(
10
);
}
}
PUSICANControl
.
InitRNodeConfig
(
LWidthManager
.
Line_NodeAddr
,
true
);
PUSICANControl
.
InitRNodeConfig
(
LWidthManager
.
Line_NodeAddr
,
true
);
Thread
.
Sleep
(
10
);
//所有轴原点返回
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
...
...
@@ -348,15 +348,15 @@ namespace TSA_V.DeviceLibrary
}
public
static
void
StopWork
()
{
StopMove
();
StopMove
();
if
(
Status
.
Equals
(
TSAVStatus
.
Reset
))
{
Status
=
TSAVStatus
.
Wait
;
}
}
private
static
bool
IsProcess
=
false
;
private
static
DateTime
preShowImageTime
=
DateTime
.
Now
;
private
static
DateTime
preShowImageTime
=
DateTime
.
Now
;
/// <summary>
/// 工作定时器
/// </summary>
...
...
@@ -433,16 +433,16 @@ namespace TSA_V.DeviceLibrary
}
CheckPusicanAlarm
();
}
// IOManager.IOMove(IOManager.Warmer_Work, IO_VALUE.LOW);
}
// IOManager.IOMove(IOManager.Warmer_Work, IO_VALUE.LOW);
}
catch
(
Exception
ex
)
{
LogUtil
.
error
(
"workTimer_Elapsed出现错误:"
+
ex
.
ToString
());
}
IsProcess
=
false
;
IsProcess
=
false
;
}
private
static
void
WorkProcess
()
private
static
void
WorkProcess
()
{
if
(
Work
.
IsWaitMove
)
{
...
...
@@ -450,22 +450,22 @@ namespace TSA_V.DeviceLibrary
CheckWorkWait
();
}
if
(!(
Work
.
IsWaitMove
))
{
{
TimeSpan
span
=
DateTime
.
Now
-
Work
.
endWorkTime
;
bool
IsFootOk
=
IOManager
.
IOValue
(
IOManager
.
Footrest_Single
).
Equals
(
IO_VALUE
.
HIGH
)
&&
(
WorkMode
.
Equals
(
0
));
bool
IsFootOk
=
IOManager
.
IOValue
(
IOManager
.
Footrest_Single
).
Equals
(
IO_VALUE
.
HIGH
)
&&
(
WorkMode
.
Equals
(
0
));
if
(
Work
.
WorkType
.
Equals
(
1
))
{
{
//等待脚踏板信号
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
AuToModeSeconds
&&
IsDebug
)
||
(
span
.
TotalSeconds
>
AuToModeSeconds
&&
WorkMode
.
Equals
(
1
))
)
)
{
Work
.
MoveToNextPoint
(
true
);
}
}
else
if
(
Work
.
WorkType
.
Equals
(
2
)
||
Work
.
WorkType
.
Equals
(
3
))
{
{
if
(
Work
.
WorkType
.
Equals
(
2
))
{
if
(
IsFootOk
||
(
span
.
TotalSeconds
>
Work
.
currPoint
.
WeldTime
+
6
&&
IsDebug
...
...
@@ -499,7 +499,7 @@ namespace TSA_V.DeviceLibrary
if
(
span
.
TotalSeconds
<
10
)
{
return
;
}
preCheckTime
=
DateTime
.
Now
;
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
{
...
...
@@ -517,7 +517,7 @@ namespace TSA_V.DeviceLibrary
Thread
.
Sleep
(
100
);
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
);
return
;
}
...
...
@@ -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
(!
Work
.
IsWorking
)
{
//StartWork(BoardManager.CurrBoard);
return
false
;
return
false
;
}
if
(
Work
.
IsWaitMove
)
{
...
...
@@ -541,17 +541,18 @@ namespace TSA_V.DeviceLibrary
}
if
(!(
Work
.
IsWaitMove
))
{
Work
.
MoveToNextPoint
(
isNext
,
isResetBoard
);
Work
.
MoveToNextPoint
(
isNext
,
isResetBoard
);
return
true
;
}
}
return
false
;
}
return
false
;
}
public
static
void
StopRun
()
{
StopMove
();
//停止红外线灯
// IOManager.IOMove(IOManager.Inerared_Lamp, IO_VALUE.LOW);
// IOManager.IOMove(IOManager.Inerared_Lamp, IO_VALUE.LOW);
IOManager
.
IOMove
(
IOManager
.
SMEMA_Down
,
IO_VALUE
.
LOW
);
IOManager
.
IOMove
(
IOManager
.
SMEMA_Up
,
IO_VALUE
.
LOW
);
workTimer
.
Enabled
=
false
;
...
...
@@ -568,10 +569,10 @@ namespace TSA_V.DeviceLibrary
CylinderMove
(
IOManager
.
SideCylinder_Forward
,
IOManager
.
SideCylinder_Back
,
false
);
Work
.
StopWork
();
LineStep
.
EndMove
();
IOManager
.
IOMove
(
IOManager
.
Line_FStart
,
IO_VALUE
.
LOW
);
Thread
.
Sleep
(
100
);
Thread
.
Sleep
(
100
);
foreach
(
Dictionary
<
int
,
NodeInfo
>
map
in
RotateMap
.
Values
)
{
foreach
(
NodeInfo
nodeid
in
map
.
Values
)
...
...
@@ -587,16 +588,16 @@ namespace TSA_V.DeviceLibrary
TimeSpan
span
=
DateTime
.
Now
-
Work
.
LastSetpTime
;
List
<
WaitResultInfo
>
list
=
Work
.
waitList
;
string
waitMsg
=
""
;
bool
isOk
=
WaitResultInfo
.
GetWaitResult
(
list
,
span
,
false
,
out
waitMsg
);
bool
isOk
=
WaitResultInfo
.
GetWaitResult
(
list
,
span
,
false
,
out
waitMsg
);
if
(
isOk
)
{
Work
.
EndWait
();
}
if
(
Work
.
IsWaitMove
)
{
{
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
);
}
}
...
...
@@ -624,7 +625,46 @@ namespace TSA_V.DeviceLibrary
return
true
;
}
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
{
...
...
PUSICANLibrary/PUSICANControl.cs
查看文件 @
d18889e
...
...
@@ -710,20 +710,12 @@ namespace PUSICANLibrary
Thread
.
Sleep
(
100
);
//重置位置
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
;
}
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
());
...
...
@@ -846,9 +838,8 @@ namespace PUSICANLibrary
Thread
.
Sleep
(
10
);
//设置为位置模式
PUSICANControl
.
WriteSDO
(
node
,
CAN_Address
.
MoveType
,
movetype
);
Thread
.
Sleep
(
100
);
bool
isLineslv
=
node
.
Equals
(
isLineSlv
);
PUSICANControl
.
SetSpeed
(
node
);
Thread
.
Sleep
(
100
);
PUSICANControl
.
SetSpeed
(
node
,
isLineSlv
);
Thread
.
Sleep
(
10
);
//所有轴走到待机点
PUSICANControl
.
AbsMove
(
node
,
targetDefaultPosition
);
...
...
TSA-V/App.config
查看文件 @
d18889e
...
...
@@ -90,12 +90,12 @@
<
add
key
=
"Line_HomeStartSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_HomeStopSpeed"
value
=
"1000"
/>
<
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_StopSpeed"
value
=
"1000"
/>
<
add
key
=
"Line_AddSpeed"
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_HomeWidth"
value
=
"508"
/>
...
...
TSA-V/FrmMaintenance.cs
查看文件 @
d18889e
...
...
@@ -31,6 +31,26 @@ namespace TSA_V
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
();
this
.
Visible
=
false
;
frmCom
.
ShowDialog
();
...
...
TSA-V/FrmMenu.Designer.cs
查看文件 @
d18889e
...
...
@@ -36,6 +36,7 @@ namespace TSA_V
this
.
btnExit
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
btnWork
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
panel1
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
lblMsg
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnHistory
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
LblUserName
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
btnScreenTest
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
@@ -58,9 +59,10 @@ namespace TSA_V
//
this
.
lblVersion
.
AutoSize
=
true
;
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
.
Size
=
new
System
.
Drawing
.
Size
(
7
7
,
12
);
this
.
lblVersion
.
Size
=
new
System
.
Drawing
.
Size
(
7
5
,
17
);
this
.
lblVersion
.
TabIndex
=
11
;
this
.
lblVersion
.
Text
=
"版本号 1.1.2"
;
//
...
...
@@ -72,7 +74,7 @@ namespace TSA_V
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
.
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
.
Size
=
new
System
.
Drawing
.
Size
(
89
,
37
);
this
.
btnExit
.
TabIndex
=
9
;
...
...
@@ -98,6 +100,7 @@ namespace TSA_V
// panel1
//
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
.
LblUserName
);
this
.
panel1
.
Controls
.
Add
(
this
.
lblVersion
);
...
...
@@ -114,6 +117,17 @@ namespace TSA_V
this
.
panel1
.
Size
=
new
System
.
Drawing
.
Size
(
861
,
453
);
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
//
this
.
btnHistory
.
BackColor
=
System
.
Drawing
.
Color
.
Transparent
;
...
...
@@ -134,9 +148,10 @@ namespace TSA_V
//
this
.
LblUserName
.
AutoSize
=
true
;
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
.
Size
=
new
System
.
Drawing
.
Size
(
4
1
,
12
);
this
.
LblUserName
.
Size
=
new
System
.
Drawing
.
Size
(
4
3
,
17
);
this
.
LblUserName
.
TabIndex
=
18
;
this
.
LblUserName
.
Text
=
"label1"
;
//
...
...
@@ -301,5 +316,6 @@ namespace TSA_V
private
System
.
Windows
.
Forms
.
Button
btnScreenTest
;
private
System
.
Windows
.
Forms
.
Button
btnHistory
;
private
System
.
Windows
.
Forms
.
Label
LblUserName
;
private
System
.
Windows
.
Forms
.
Label
lblMsg
;
}
}
\ No newline at end of file
TSA-V/FrmMenu.cs
查看文件 @
d18889e
...
...
@@ -46,6 +46,7 @@ namespace TSA_V
btnProduct
.
Visible
=
false
;
btnCom
.
Visible
=
false
;
}
lblMsg
.
Text
=
""
;
//if (FormManager.UserInfo.Limit.Equals(UserLimit.Admin))
//{
// btnMaintenance.Visible = true;
...
...
@@ -292,14 +293,7 @@ namespace TSA_V
}
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
;
FrmMaintenance
.
instance
.
Show
();
this
.
Visible
=
false
;
...
...
@@ -338,6 +332,7 @@ namespace TSA_V
{
try
{
lblMsg
.
Text
=
TSAVBean
.
GetShowMsg
();
Screen
[]
sc
=
Screen
.
AllScreens
;
if
((!
FrmProjectorScreen
.
instance
.
ISShow
)
&&
sc
.
Length
>
FrmProjectorScreen
.
instance
.
ScreenIndex
)
{
...
...
TSA-V/deviceDebug/FrmPusicanTest.cs
查看文件 @
d18889e
...
...
@@ -55,6 +55,7 @@ namespace TSA_V
FormStatus
(
false
);
}
SetScreen
();
cmbNode
.
SelectedIndex
=
cmbNode
.
Items
.
Count
-
1
;
}
private
void
FormStatus
(
bool
open
)
{
...
...
TSA-V/workForm/FrmTSAV.cs
查看文件 @
d18889e
...
...
@@ -233,84 +233,15 @@ namespace TSA_V
}
}
FormStatus
();
if
(
TSAVBean
.
IsInSuddenDown
)
{
lblMsg
.
Text
=
ResourceCulture
.
GetString
(
ResourceCulture
.
DeviceInSuddenStop
,
"设备急停中"
);
//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
))
lblMsg
.
Text
=
TSAVBean
.
GetShowMsg
();
if
(
TSAVBean
.
Status
.
Equals
(
TSAVStatus
.
Runing
))
{
//如果没有开始工作,自动开始工作
if
(!
TSAVBean
.
Work
.
IsWorking
&&
btnStart
.
Enabled
)
{
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
))
{
ShowTSAVPoint
();
...
...
@@ -387,18 +318,41 @@ namespace TSA_V
{
btnSave
.
Enabled
=
true
;
btnGoHome
.
Enabled
=
true
;
if
(
TSAVBean
.
Status
<=(
TSAVStatus
.
Wait
))
if
(
TSAVBean
.
Status
<=
(
TSAVStatus
.
Wait
))
{
btnStart
.
Visible
=
true
;
btnGoHome
.
Visible
=
false
;
}
else
{
{
btnStart
.
Visible
=
false
;
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
)
{
StartRun
();
FormStatus
();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论