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
08bdbac4
Commit
08bdbac4
authored
May 28, 2018
by
wangjunqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加STD批处理非文件接口
parent
b7766bf5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
8 deletions
+38
-8
MDIBase.cs
GcDevicePc/MDIBase.cs
+29
-8
WaitForm.cs
GcDevicePc/WaitForm.cs
+9
-0
No files found.
GcDevicePc/MDIBase.cs
View file @
08bdbac4
...
@@ -354,13 +354,17 @@ namespace GcDevicePc
...
@@ -354,13 +354,17 @@ namespace GcDevicePc
}
}
public
void
WaitHMIFree
()
public
void
WaitHMIFree
()
{
if
(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmistatus
!=
0
)
{
{
this
.
backgroundWorker1
.
RunWorkerAsync
();
this
.
backgroundWorker1
.
RunWorkerAsync
();
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker1
);
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker1
,
"Free"
);
form
.
ShowDialog
(
this
);
form
.
ShowDialog
(
this
);
form
.
Close
();
form
.
Close
();
}
}
}
private
void
backgroundWorker2_DoWork
(
object
sender
,
DoWorkEventArgs
e
)
private
void
backgroundWorker2_DoWork
(
object
sender
,
DoWorkEventArgs
e
)
{
{
BackgroundWorker
worker
=
sender
as
BackgroundWorker
;
BackgroundWorker
worker
=
sender
as
BackgroundWorker
;
...
@@ -416,13 +420,17 @@ namespace GcDevicePc
...
@@ -416,13 +420,17 @@ namespace GcDevicePc
}
}
}
}
public
void
WaitHMIWork
()
public
void
WaitHMIWork
()
{
if
(
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
<
0
||
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
>
5
)
{
{
this
.
backgroundWorker2
.
RunWorkerAsync
();
this
.
backgroundWorker2
.
RunWorkerAsync
();
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker2
);
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker2
,
"Work"
);
form
.
ShowDialog
(
this
);
form
.
ShowDialog
(
this
);
form
.
Close
();
form
.
Close
();
}
}
}
public
void
SendStopCMD
()
public
void
SendStopCMD
()
{
{
try
try
...
@@ -1171,6 +1179,19 @@ namespace GcDevicePc
...
@@ -1171,6 +1179,19 @@ namespace GcDevicePc
}
}
}
}
/// <summary>
/// 直接执行STD批处理
/// </summary>
/// <param name="count">次数</param>
private
void
RunTableOptWithCount
(
ushort
count
)
{
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
hmiopt
.
SetBatCount
(
count
);
SendSTDCMD
();
}
}
/// <summary>
/// <summary>
/// 更新所需,关闭HMI
/// 更新所需,关闭HMI
/// </summary>
/// </summary>
...
...
GcDevicePc/WaitForm.cs
View file @
08bdbac4
...
@@ -21,6 +21,15 @@ namespace GcDevicePc
...
@@ -21,6 +21,15 @@ namespace GcDevicePc
this
.
backgroundWorker1
.
RunWorkerCompleted
+=
new
RunWorkerCompletedEventHandler
(
backgroundWorker1_RunWorkerCompleted
);
this
.
backgroundWorker1
.
RunWorkerCompleted
+=
new
RunWorkerCompletedEventHandler
(
backgroundWorker1_RunWorkerCompleted
);
}
}
public
WaitForm
(
BackgroundWorker
backgroundWorker1
,
String
title
)
{
InitializeComponent
();
this
.
backgroundWorker1
=
backgroundWorker1
;
this
.
backgroundWorker1
.
ProgressChanged
+=
new
ProgressChangedEventHandler
(
backgroundWorker1_ProgressChanged
);
this
.
backgroundWorker1
.
RunWorkerCompleted
+=
new
RunWorkerCompletedEventHandler
(
backgroundWorker1_RunWorkerCompleted
);
this
.
Text
=
"Wait For "
+
title
;
}
void
backgroundWorker1_RunWorkerCompleted
(
object
sender
,
RunWorkerCompletedEventArgs
e
)
void
backgroundWorker1_RunWorkerCompleted
(
object
sender
,
RunWorkerCompletedEventArgs
e
)
{
{
this
.
Close
();
//执行完之后,直接关闭页面
this
.
Close
();
//执行完之后,直接关闭页面
...
...
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