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
f043db03
Commit
f043db03
authored
Jun 04, 2019
by
liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小细节修改
parent
2f1c2e54
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
155 additions
and
112 deletions
+155
-112
MDIBase.cs
GcDevicePc/MDIBase.cs
+93
-91
HMIControl.cs
GcDevicePc/ProThread/HMIControl.cs
+16
-1
Program.cs
GcDevicePc/Program.cs
+17
-17
TestForm.Designer.cs
GcDevicePc/TestForm.Designer.cs
+22
-1
TestForm.cs
GcDevicePc/TestForm.cs
+7
-2
No files found.
GcDevicePc/MDIBase.cs
View file @
f043db03
This diff is collapsed.
Click to expand it.
GcDevicePc/ProThread/HMIControl.cs
View file @
f043db03
...
...
@@ -199,7 +199,22 @@ namespace GcDevicePc.ProThread
}
}
public
void
testr12
(
ushort
addr
,
ushort
statue
)
{
int
ret
;
int
count
=
0
;
ret
=
m_modbus
.
WriteSingleCoil
(
addr
,
statue
,
this
.
strIP
,
this
.
netPost
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
WriteSingleCoil
(
addr
,
statue
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
}
/// <summary>
/// 点火
/// </summary>
...
...
GcDevicePc/Program.cs
View file @
f043db03
...
...
@@ -12,24 +12,24 @@ namespace GcDevicePc
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
bool
createNew
;
Application
.
Run
(
new
TestForm
());
//
Application.Run(new TestForm());
{
//
using (System.Threading.Mutex mutex = new System.Threading.Mutex(true, Application.ProductName, out createNew))
//
{
//
if (createNew)
//
{
//
Application.Run(new StartForm());
//
mutex.ReleaseMutex();
//
}
//
else
//
{
//
MessageBox.Show("应用程序已经在运行中...");
//
System.Threading.Thread.Sleep(1000);
//
Application.Exit();
//
System.Diagnostics.Process.GetCurrentProcess().Kill();
//
// System.Environment.Exit(1);
//
}
//
}
using
(
System
.
Threading
.
Mutex
mutex
=
new
System
.
Threading
.
Mutex
(
true
,
Application
.
ProductName
,
out
createNew
))
{
if
(
createNew
)
{
Application
.
Run
(
new
StartForm
());
mutex
.
ReleaseMutex
();
}
else
{
MessageBox
.
Show
(
"应用程序已经在运行中..."
);
System
.
Threading
.
Thread
.
Sleep
(
1000
);
Application
.
Exit
();
System
.
Diagnostics
.
Process
.
GetCurrentProcess
().
Kill
();
// System.Environment.Exit(1);
}
}
}
}
}
...
...
GcDevicePc/TestForm.Designer.cs
View file @
f043db03
...
...
@@ -33,6 +33,8 @@
this
.
gcTitle1
=
new
GcDevicePc
.
Controls
.
GCTitle
();
this
.
button3
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
textBox1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
SuspendLayout
();
//
// button1
...
...
@@ -47,7 +49,7 @@
//
// button2
//
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
2
50
,
364
);
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
2
41
,
318
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
23
);
this
.
button2
.
TabIndex
=
1
;
...
...
@@ -83,11 +85,27 @@
this
.
button4
.
UseVisualStyleBackColor
=
true
;
this
.
button4
.
Click
+=
new
System
.
EventHandler
(
this
.
Button4_Click
);
//
// textBox1
//
this
.
textBox1
.
Location
=
new
System
.
Drawing
.
Point
(
241
,
274
);
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
21
);
this
.
textBox1
.
TabIndex
=
5
;
//
// textBox2
//
this
.
textBox2
.
Location
=
new
System
.
Drawing
.
Point
(
357
,
274
);
this
.
textBox2
.
Name
=
"textBox2"
;
this
.
textBox2
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
21
);
this
.
textBox2
.
TabIndex
=
5
;
//
// TestForm
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
800
,
583
);
this
.
Controls
.
Add
(
this
.
textBox2
);
this
.
Controls
.
Add
(
this
.
textBox1
);
this
.
Controls
.
Add
(
this
.
button4
);
this
.
Controls
.
Add
(
this
.
button3
);
this
.
Controls
.
Add
(
this
.
gcTitle1
);
...
...
@@ -96,6 +114,7 @@
this
.
Name
=
"TestForm"
;
this
.
Text
=
"TestForm"
;
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
}
...
...
@@ -106,5 +125,7 @@
private
Controls
.
GCTitle
gcTitle1
;
private
System
.
Windows
.
Forms
.
Button
button3
;
private
System
.
Windows
.
Forms
.
Button
button4
;
private
System
.
Windows
.
Forms
.
TextBox
textBox1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox2
;
}
}
\ No newline at end of file
GcDevicePc/TestForm.cs
View file @
f043db03
using
GcDevicePc.Common
;
using
GcDevicePc.ConfigMethod
;
using
GcDevicePc.Controls
;
using
GcDevicePc.ProThread
;
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
...
...
@@ -115,16 +116,20 @@ namespace GcDevicePc
}
HMIControl
hMI
=
new
HMIControl
(
"172.16.1.58"
,
502
);
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
//MessageBox.Show("asd");
//this.pictureMenu1.PMOptbtnstatus = 4;
//(this.title.Controls.Find("pictureMenu1", true)[0] as PictureMenu).PMOptbtnstatus = 3;
//tinfliang
//LMessageBox box = new LMessageBox();
//box.Show(100, 100, this.Location, true, "1230", "3214", LMessageBox.MessageBoxType.MBT_ButtonOK);
hMI
.
testr12
(
Convert
.
ToUInt16
(
textBox1
.
Text
),
Convert
.
ToUInt16
(
textBox2
.
Text
));
}
private
void
Button3_Click
(
object
sender
,
EventArgs
e
)
...
...
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