Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
G
GC_Branch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周磊
GC_Branch
Commits
64091552
Commit
64091552
authored
Apr 17, 2018
by
wangwanxh@sina.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wang_master' of
https://gitee.com/wangwanxh/Vocs
into wang_master
parents
107efa42
cfc13949
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
42 deletions
+120
-42
AppInit.cs
GcDevicePc/AppInit.cs
+1
-1
MDIBase.cs
GcDevicePc/MDIBase.cs
+87
-40
HMIControl.cs
GcDevicePc/ProThread/HMIControl.cs
+32
-1
No files found.
GcDevicePc/AppInit.cs
View file @
64091552
...
@@ -13,7 +13,7 @@ namespace GcDevicePc
...
@@ -13,7 +13,7 @@ namespace GcDevicePc
{
{
class
AppInit
class
AppInit
{
{
/// <summary>
/// <summary>
/// 检测文件和目录是否存在
/// 检测文件和目录是否存在
/// </summary>
/// </summary>
...
...
GcDevicePc/MDIBase.cs
View file @
64091552
...
@@ -351,6 +351,17 @@ namespace GcDevicePc
...
@@ -351,6 +351,17 @@ namespace GcDevicePc
}
}
}
}
public
void
SendSTDCMD
()
{
hmiopt
.
WriteStopVal
();
WaitHMIFree
();
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
)
{
hmiopt
.
WriteSTDBatVal
();
hmiopt
.
WriteStartVal
();
}
}
private
void
SetMainFormMethodName
(
string
text
)
private
void
SetMainFormMethodName
(
string
text
)
{
{
this
.
toolStripStatusLabelText
.
Text
=
"当前运行方法:"
+
text
;
this
.
toolStripStatusLabelText
.
Text
=
"当前运行方法:"
+
text
;
...
@@ -721,8 +732,6 @@ namespace GcDevicePc
...
@@ -721,8 +732,6 @@ namespace GcDevicePc
// startbtn();
// startbtn();
}
}
//点火失败或着火焰熄灭,停止系统
//点火失败或着火焰熄灭,停止系统
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue && globaldata.m_hmibuffer.gcinfo.FireStatus[0] == 3 && globaldata.m_hmibuffer.gcinfo.methodstatus == 0 && globaldata.m_hmibuffer.gcinfo.hmistatus == 0)
//if (globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.system_Statue && globaldata.m_hmibuffer.gcinfo.FireStatus[0] == 3 && globaldata.m_hmibuffer.gcinfo.methodstatus == 0 && globaldata.m_hmibuffer.gcinfo.hmistatus == 0)
//{
//{
...
@@ -747,24 +756,28 @@ namespace GcDevicePc
...
@@ -747,24 +756,28 @@ namespace GcDevicePc
switch
(
runtype
)
switch
(
runtype
)
{
{
case
0
:
case
0
:
ButtonControl_Status
(
dest
[
5
],
0
);
//
ButtonControl_Status(dest[5], 0);
DataControl_Status
(
dest
[
5
],
0
);
DataControl_Status
(
dest
[
5
],
0
);
break
;
break
;
case
2
:
case
2
:
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
ButtonControl_Status
(
dest
[
5
],
2
);
//
ButtonControl_Status(dest[5], 2);
DataControl_Status
(
dest
[
5
],
2
);
DataControl_Status
(
dest
[
5
],
2
);
break
;
break
;
case
3
:
case
3
:
QuickRun_HeadInfo
();
QuickRun_HeadInfo
();
ButtonControl_Status
(
dest
[
5
],
1
);
//
ButtonControl_Status(dest[5], 1);
DataControl_Status
(
dest
[
5
],
1
);
DataControl_Status
(
dest
[
5
],
1
);
break
;
break
;
case
4
:
case
4
:
SingleRun_HeadInfo
();
SingleRun_HeadInfo
();
ButtonControl_Status
(
dest
[
5
],
0
);
//
ButtonControl_Status(dest[5], 0);
// DataControl_Status(dest[5], 0);
// DataControl_Status(dest[5], 0);
break
;
break
;
case
7
:
BAT_HeadInfo
(
dest
[
0
],
dest
[
1
]);
DataControl_Status
(
dest
[
5
],
7
);
break
;
default
:
default
:
Common_HeadInfo
();
Common_HeadInfo
();
break
;
break
;
...
@@ -843,35 +856,35 @@ namespace GcDevicePc
...
@@ -843,35 +856,35 @@ namespace GcDevicePc
}
}
}
}
void
ButtonControl_Status
(
ushort
flag
,
ushort
runtype
)
//
void ButtonControl_Status(ushort flag, ushort runtype)
{
//
{
invokeDelegate
update_ButtonStatus_UI
=
()
=>
//
invokeDelegate update_ButtonStatus_UI = () =>
{
//
{
switch
(
flag
)
//
switch (flag)
{
//
{
case
0
:
//
case 0:
case
1
:
//
case 1:
case
2
:
//
case 2:
// ChangeButton(0);
//
// ChangeButton(0);
break
;
//
break;
case
3
:
//已就绪
//
case 3: //已就绪
// if (runtype == 0 && globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue != 1)
//
// if (runtype == 0 && globaldata.m_pcbuffer.gcpcinfo.pcworkinfo.work_Statue != 1)
// ChangeButton(1);
//
// ChangeButton(1);
break
;
//
break;
case
4
:
//
case 4:
case
5
:
//
case 5:
//ChangeButton(2);
//
//ChangeButton(2);
break
;
//
break;
case
6
:
//
case 6:
// ChangeButton(0);
//
// ChangeButton(0);
break
;
//
break;
case
7
:
//
case 7:
// ChangeButton(0);
//
// ChangeButton(0);
break
;
//
break;
}
//
}
};
//
};
Invoke
(
update_ButtonStatus_UI
);
//
Invoke(update_ButtonStatus_UI);
}
//
}
/// <summary>
/// <summary>
/// 显示系统连接状态和方法运行
/// 显示系统连接状态和方法运行
...
@@ -1062,7 +1075,6 @@ namespace GcDevicePc
...
@@ -1062,7 +1075,6 @@ namespace GcDevicePc
}
}
Thread
.
Sleep
(
1000
);
Thread
.
Sleep
(
1000
);
}
}
}
}
private
void
MDIBase_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
private
void
MDIBase_FormClosing
(
object
sender
,
FormClosingEventArgs
e
)
...
@@ -1243,9 +1255,6 @@ namespace GcDevicePc
...
@@ -1243,9 +1255,6 @@ namespace GcDevicePc
WaitHMIWork
();
WaitHMIWork
();
Thread
.
Sleep
(
500
);
Thread
.
Sleep
(
500
);
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
true
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
true
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
globaldata
.
starttimer
=
0
;
globaldata
.
starttimer
=
0
;
...
@@ -1272,7 +1281,11 @@ namespace GcDevicePc
...
@@ -1272,7 +1281,11 @@ namespace GcDevicePc
hmiopt
.
FireUPWork
(
flag
,
time1
,
time2
);
hmiopt
.
FireUPWork
(
flag
,
time1
,
time2
);
}
}
//调试运行表接口
/// <summary>
/// 调试运行表接口
/// </summary>
/// <param name="folder">批处理目录</param>
/// <param name="runtablename">批处理文件名(带.ini)</param>
private
void
RunTableOpt
(
String
folder
,
String
runtablename
)
private
void
RunTableOpt
(
String
folder
,
String
runtablename
)
{
{
bool
ret
=
false
;
bool
ret
=
false
;
...
@@ -1299,6 +1312,40 @@ namespace GcDevicePc
...
@@ -1299,6 +1312,40 @@ namespace GcDevicePc
}
}
}
}
/// <summary>
/// 调试运行表接口
/// </summary>
/// <param name="folder">批处理目录</param>
/// <param name="runtablename">批处理文件名(带.ini)</param>
/// <param name="count">批处理运行次数</param>
private
void
RunTableOptWithCount
(
String
folder
,
String
runtablename
,
ushort
count
)
{
bool
ret
=
false
;
RunTableHelper
runtable
=
new
RunTableHelper
(
folder
,
runtablename
);
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
string
lfilename
;
string
rfilename
;
FileServerClient
rtclient
=
new
FileServerClient
();
rtclient
.
WtClientInit
(
globaldata
.
connection_ip
,
globaldata
.
fileserverport
);
for
(
int
i
=
1
;
i
<
runtable
.
_methodname
.
Count
;
i
++)
{
rfilename
=
runtable
.
_methodname
[
i
];
lfilename
=
Path
.
Combine
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
MethodFolder
,
rfilename
);
rtclient
.
WtClientCopytoServer
(
rfilename
,
lfilename
,
globaldata
.
remoteFolder
+
"仪器方法\\"
);
Thread
.
Sleep
(
200
);
}
rtclient
.
WtClientCopytoServer
(
"RunMethodStd.ini"
,
Path
.
Combine
(
folder
,
runtablename
),
globaldata
.
remoteFolder
+
"运行表\\"
);
hmiopt
.
SetBatCount
(
count
);
SendSTDCMD
();
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfileinfo
.
cur_RunTab
=
Path
.
Combine
(
folder
,
runtablename
);
ret
=
true
;
}
}
/// <summary>
/// <summary>
/// 更新所需,关闭HMI
/// 更新所需,关闭HMI
/// </summary>
/// </summary>
...
...
GcDevicePc/ProThread/HMIControl.cs
View file @
64091552
...
@@ -53,6 +53,14 @@ namespace GcDevicePc.ProThread
...
@@ -53,6 +53,14 @@ namespace GcDevicePc.ProThread
ret
=
m_modbus
.
WriteHoldingReg
(
148
,
mystate
,
this
.
strIP
,
this
.
netPost
);
ret
=
m_modbus
.
WriteHoldingReg
(
148
,
mystate
,
this
.
strIP
,
this
.
netPost
);
}
}
public
void
WriteSTDBatVal
()
{
int
ret
;
ushort
mystate
=
(
ushort
)
0x1
;
if
(
this
.
setflag
)
ret
=
m_modbus
.
WriteHoldingReg
(
151
,
mystate
,
this
.
strIP
,
this
.
netPost
);
}
public
void
WriteOpenVal
()
public
void
WriteOpenVal
()
{
{
int
ret
;
int
ret
;
...
@@ -349,7 +357,30 @@ namespace GcDevicePc.ProThread
...
@@ -349,7 +357,30 @@ namespace GcDevicePc.ProThread
}
}
return
(
ret
==
0
)
?
true
:
false
;
return
(
ret
==
0
)
?
true
:
false
;
}
}
public
bool
SetBatCount
(
ushort
val
)
{
ushort
mystate
=
val
;
int
ret
=
0
;
int
count
=
0
;
ushort
addr
=
10
;
if
(
this
.
setflag
)
{
ret
=
m_modbus
.
WriteHoldingReg
(
addr
,
mystate
,
this
.
strIP
,
this
.
netPost
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
WriteHoldingReg
(
addr
,
mystate
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
200
);
if
(
count
==
3
)
break
;
}
}
return
(
ret
==
0
)
?
true
:
false
;
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment