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
1085a985
Commit
1085a985
authored
Jul 29, 2019
by
liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
辅助工具添加校零标阀rl11 12开关的功能,修改了外部通讯协议
parent
129cc874
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
524 additions
and
592 deletions
+524
-592
NModbusSlave.cs
GcDevicePc/Common/NModbusSlave.cs
+162
-429
FID.Designer.cs
GcDevicePc/ConfigMethod/FID.Designer.cs
+20
-18
FID.cs
GcDevicePc/ConfigMethod/FID.cs
+73
-0
IPPIP.Designer.cs
GcDevicePc/ConfigMethod/injectionport/IPPIP.Designer.cs
+3
-6
IPPIP.cs
GcDevicePc/ConfigMethod/injectionport/IPPIP.cs
+26
-3
EPCTips.Designer.cs
GcDevicePc/EPCTips.Designer.cs
+2
-2
FormUser.cs
GcDevicePc/FormUser.cs
+23
-2
MDIBase.Designer.cs
GcDevicePc/MDIBase.Designer.cs
+17
-3
MDIBase.cs
GcDevicePc/MDIBase.cs
+96
-27
GcDataTh.cs
GcDevicePc/ProThread/GcDataTh.cs
+38
-0
HMIControl.cs
GcDevicePc/ProThread/HMIControl.cs
+9
-90
Program.cs
GcDevicePc/Program.cs
+1
-1
TestForm.Designer.cs
GcDevicePc/TestForm.Designer.cs
+14
-1
TestForm.cs
GcDevicePc/TestForm.cs
+5
-9
auxtool.Designer.cs
GcDevicePc/auxtool.Designer.cs
+2
-0
auxtool.cs
GcDevicePc/auxtool.cs
+31
-0
globaldata.cs
GcDevicePc/globaldata.cs
+2
-1
No files found.
GcDevicePc/Common/NModbusSlave.cs
View file @
1085a985
This diff is collapsed.
Click to expand it.
GcDevicePc/ConfigMethod/FID.Designer.cs
View file @
1085a985
...
...
@@ -29,6 +29,8 @@
private
void
InitializeComponent
()
{
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
txtyuzhi
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
cListBoxSign
=
new
System
.
Windows
.
Forms
.
CheckedListBox
();
this
.
cBox
自动点火
=
new
System
.
Windows
.
Forms
.
CheckBox
();
this
.
cBox
自动调零
=
new
System
.
Windows
.
Forms
.
CheckBox
();
...
...
@@ -59,8 +61,6 @@
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label2
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label5
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
txtyuzhi
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -105,6 +105,22 @@
this
.
groupBox1
.
TabStop
=
false
;
this
.
groupBox1
.
Text
=
"FID设置"
;
//
// txtyuzhi
//
this
.
txtyuzhi
.
Location
=
new
System
.
Drawing
.
Point
(
423
,
84
);
this
.
txtyuzhi
.
Name
=
"txtyuzhi"
;
this
.
txtyuzhi
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
21
);
this
.
txtyuzhi
.
TabIndex
=
12
;
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
388
,
91
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
29
,
12
);
this
.
label5
.
TabIndex
=
11
;
this
.
label5
.
Text
=
"阈值"
;
//
// cListBoxSign
//
this
.
cListBoxSign
.
BackColor
=
System
.
Drawing
.
SystemColors
.
Control
;
...
...
@@ -188,6 +204,7 @@
this
.
tb
空气压力设定
.
Name
=
"tb空气压力设定"
;
this
.
tb
空气压力设定
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
21
);
this
.
tb
空气压力设定
.
TabIndex
=
2
;
this
.
tb
空气压力设定
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
Tb
空气压力设定
_TextChanged
);
this
.
tb
空气压力设定
.
KeyPress
+=
new
System
.
Windows
.
Forms
.
KeyPressEventHandler
(
this
.
TextBoxDec_KeyPress
);
//
// tb尾吹气压力设定
...
...
@@ -223,6 +240,7 @@
this
.
tb
氢气压力设定
.
Name
=
"tb氢气压力设定"
;
this
.
tb
氢气压力设定
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
21
);
this
.
tb
氢气压力设定
.
TabIndex
=
2
;
this
.
tb
氢气压力设定
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
Tb
氢气压力设定
_TextChanged
);
this
.
tb
氢气压力设定
.
KeyPress
+=
new
System
.
Windows
.
Forms
.
KeyPressEventHandler
(
this
.
TextBoxDec_KeyPress
);
//
// cBox空气
...
...
@@ -395,22 +413,6 @@
this
.
label1
.
TabIndex
=
0
;
this
.
label1
.
Text
=
"FID"
;
//
// label5
//
this
.
label5
.
AutoSize
=
true
;
this
.
label5
.
Location
=
new
System
.
Drawing
.
Point
(
388
,
91
);
this
.
label5
.
Name
=
"label5"
;
this
.
label5
.
Size
=
new
System
.
Drawing
.
Size
(
29
,
12
);
this
.
label5
.
TabIndex
=
11
;
this
.
label5
.
Text
=
"阈值"
;
//
// txtyuzhi
//
this
.
txtyuzhi
.
Location
=
new
System
.
Drawing
.
Point
(
423
,
84
);
this
.
txtyuzhi
.
Name
=
"txtyuzhi"
;
this
.
txtyuzhi
.
Size
=
new
System
.
Drawing
.
Size
(
62
,
21
);
this
.
txtyuzhi
.
TabIndex
=
12
;
//
// FID
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
GcDevicePc/ConfigMethod/FID.cs
View file @
1085a985
...
...
@@ -25,6 +25,12 @@ namespace GcDevicePc.ConfigMethod
this
.
methodconfig
=
methodconfig
;
}
public
FID
()
{
InitializeComponent
();
}
int
configTemp
;
public
void
reflashContent
(
int
index
)
...
...
@@ -207,5 +213,72 @@ namespace GcDevicePc.ConfigMethod
}
}
}
private
double
hlastnum
;
private
void
hText_KeyDown
(
object
sender
,
KeyEventArgs
e
)
{
if
(!
string
.
IsNullOrEmpty
((
sender
as
TextBox
).
Text
))
{
hlastnum
=
Convert
.
ToDouble
((
sender
as
TextBox
).
Text
);
}
else
{
hlastnum
=
0
;
}
}
private
void
hText_KeyUp
(
object
sender
,
KeyEventArgs
e
)
{
if
(!
string
.
IsNullOrEmpty
((
sender
as
TextBox
).
Text
))
{
double
nextnum
=
Convert
.
ToDouble
((
sender
as
TextBox
).
Text
);
if
(
nextnum
<
5
)
{
MessageBox
.
Show
(
"流量设置不能小于5"
);
(
sender
as
TextBox
).
Text
=
hlastnum
.
ToString
();
}
if
(
nextnum
>
200
)
{
MessageBox
.
Show
(
"流量设置不能大于200"
);
(
sender
as
TextBox
).
Text
=
hlastnum
.
ToString
();
}
}
}
private
void
Tb
空气压力设定
_TextChanged
(
object
sender
,
EventArgs
e
)
{
//if (!string.IsNullOrEmpty((sender as TextBox).Text))
//{
// double nextnum = Convert.ToDouble((sender as TextBox).Text);
// if (nextnum < 50)
// {
// MessageBox.Show("空气流量设置不能小于50");
// (sender as TextBox).Text = "50";
// }
// if (nextnum > 500)
// {
// MessageBox.Show("空气流量设置不能大于500");
// (sender as TextBox).Text = "50";
// }
//}
}
private
void
Tb
氢气压力设定
_TextChanged
(
object
sender
,
EventArgs
e
)
{
//if (!string.IsNullOrEmpty((sender as TextBox).Text))
//{
// double nextnum = Convert.ToDouble((sender as TextBox).Text);
// if (nextnum < 5)
// {
// MessageBox.Show("氢气流量设置不能小于5");
// (sender as TextBox).Text = hlastnum.ToString();
// }
// if (nextnum > 200)
// {
// MessageBox.Show("氢气流量设置不能大于200");
// (sender as TextBox).Text = hlastnum.ToString();
// }
//}
}
}
}
GcDevicePc/ConfigMethod/injectionport/IPPIP.Designer.cs
View file @
1085a985
...
...
@@ -77,13 +77,12 @@
this
.
cbHeater
.
Checked
=
true
;
this
.
cbHeater
.
CheckState
=
System
.
Windows
.
Forms
.
CheckState
.
Checked
;
this
.
cbHeater
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
11F
,
System
.
Drawing
.
FontStyle
.
Regular
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
cbHeater
.
Location
=
new
System
.
Drawing
.
Point
(
67
,
153
);
this
.
cbHeater
.
Location
=
new
System
.
Drawing
.
Point
(
99
,
155
);
this
.
cbHeater
.
Name
=
"cbHeater"
;
this
.
cbHeater
.
Size
=
new
System
.
Drawing
.
Size
(
71
,
19
);
this
.
cbHeater
.
TabIndex
=
3
;
this
.
cbHeater
.
Text
=
"加热器"
;
this
.
cbHeater
.
UseVisualStyleBackColor
=
true
;
this
.
cbHeater
.
Visible
=
false
;
//
// txtHeater
//
...
...
@@ -111,8 +110,7 @@
this
.
txtFlow
.
Name
=
"txtFlow"
;
this
.
txtFlow
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
24
);
this
.
txtFlow
.
TabIndex
=
8
;
this
.
txtFlow
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyDown
);
this
.
txtFlow
.
KeyUp
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyUp
);
this
.
txtFlow
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
TxtFlow_TextChanged
);
//
// txtPressure
//
...
...
@@ -121,8 +119,7 @@
this
.
txtPressure
.
Name
=
"txtPressure"
;
this
.
txtPressure
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
24
);
this
.
txtPressure
.
TabIndex
=
9
;
this
.
txtPressure
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyDown
);
this
.
txtPressure
.
KeyUp
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyUp
);
this
.
txtPressure
.
TextChanged
+=
new
System
.
EventHandler
(
this
.
TxtFlow_TextChanged
);
//
// txtSeptumBlowingflow
//
...
...
GcDevicePc/ConfigMethod/injectionport/IPPIP.cs
View file @
1085a985
...
...
@@ -402,9 +402,14 @@ namespace GcDevicePc.ConfigMethod.injectionport
if
(!
string
.
IsNullOrEmpty
((
sender
as
TextBox
).
Text
))
{
double
nextnum
=
Convert
.
ToDouble
((
sender
as
TextBox
).
Text
);
if
(
nextnum
>
100
)
if
(
nextnum
<
5
)
{
MessageBox
.
Show
(
"流量设置不能大于100"
);
MessageBox
.
Show
(
"流量设置不能小于5"
);
(
sender
as
TextBox
).
Text
=
lastnum
.
ToString
();
}
if
(
nextnum
>
200
)
{
MessageBox
.
Show
(
"流量设置不能大于200"
);
(
sender
as
TextBox
).
Text
=
lastnum
.
ToString
();
}
}
...
...
@@ -438,6 +443,24 @@ namespace GcDevicePc.ConfigMethod.injectionport
}
}
private
void
TxtFlow_TextChanged
(
object
sender
,
EventArgs
e
)
{
//if (!string.IsNullOrEmpty((sender as TextBox).Text))
//{
// double nextnum = Convert.ToDouble((sender as TextBox).Text);
// if (nextnum < 5)
// {
// MessageBox.Show("流量设置不能小于5");
// (sender as TextBox).Text = "10";
// }
// if (nextnum > 200)
// {
// MessageBox.Show("流量设置不能大于200");
// (sender as TextBox).Text = "10";
// }
//}
}
//private void combControlMode_SelectedIndexChanged(object sender, EventArgs e)
//{
// if (combControlMode.SelectedIndex == 0)
...
...
GcDevicePc/EPCTips.Designer.cs
View file @
1085a985
...
...
@@ -35,7 +35,7 @@
// button1
//
this
.
button1
.
BackColor
=
System
.
Drawing
.
Color
.
FromArgb
(((
int
)(((
byte
)(
173
)))),
((
int
)(((
byte
)(
176
)))),
((
int
)(((
byte
)(
197
)))));
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
70
,
133
);
this
.
button1
.
Location
=
new
System
.
Drawing
.
Point
(
97
,
137
);
this
.
button1
.
Name
=
"button1"
;
this
.
button1
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
23
);
this
.
button1
.
TabIndex
=
0
;
...
...
@@ -66,7 +66,7 @@
this
.
FormBorderStyle
=
System
.
Windows
.
Forms
.
FormBorderStyle
.
SizableToolWindow
;
this
.
Name
=
"EPCTips"
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterParent
;
this
.
Text
=
"
EPCTips
"
;
this
.
Text
=
"
警 告
"
;
this
.
ResumeLayout
(
false
);
this
.
PerformLayout
();
...
...
GcDevicePc/FormUser.cs
View file @
1085a985
...
...
@@ -60,6 +60,8 @@ namespace GcDevicePc
// MessageBox.Show("点火操作禁止,FID已经点火成功");
}
CKVocAnalyzer
.
AutoAdjust
auto
;
//自动校准
private
void
buttonauto_Click
(
object
sender
,
EventArgs
e
)
{
...
...
@@ -70,8 +72,27 @@ namespace GcDevicePc
// if (CK_UI.LandIn.Island)
{
//CKVocAnalyzer.CtrlUserAdjust auto = new CKVocAnalyzer.CtrlUserAdjust(CKVocAnalyzer.CtrlUserAdjust.AdjustType.AT_Yang);
CKVocAnalyzer
.
AutoAdjust
auto
=
new
CKVocAnalyzer
.
AutoAdjust
();
if
(
auto
==
null
)
{
auto
=
new
CKVocAnalyzer
.
AutoAdjust
();
auto
.
Show
();
}
else
if
(
auto
.
IsDisposed
)
{
auto
=
null
;
auto
=
new
CKVocAnalyzer
.
AutoAdjust
();
auto
.
Show
();
}
else
{
auto
.
Activate
();
}
//if (!globaldata.usable)//表示上位机处于运行状态下不可进行自动校准
//{
//}
//Trace.WriteLine(string.Format("用户{0},进入自动校准模式", "calibration"), "sys");
}
//else
...
...
GcDevicePc/MDIBase.Designer.cs
View file @
1085a985
...
...
@@ -68,6 +68,7 @@
this
.
toolStripStatusLabelText
=
new
System
.
Windows
.
Forms
.
ToolStripStatusLabel
();
this
.
HmiStatus
=
new
System
.
Windows
.
Forms
.
ToolStripStatusLabel
();
this
.
statusStrip
=
new
System
.
Windows
.
Forms
.
StatusStrip
();
this
.
AdjustStat
=
new
System
.
Windows
.
Forms
.
ToolStripStatusLabel
();
this
.
workProgress
=
new
System
.
Windows
.
Forms
.
ToolStripProgressBar
();
this
.
timer2
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
menuStrip
.
SuspendLayout
();
...
...
@@ -347,7 +348,7 @@
this
.
toolStripStatusLabelusertime
.
DisplayStyle
=
System
.
Windows
.
Forms
.
ToolStripItemDisplayStyle
.
Text
;
this
.
toolStripStatusLabelusertime
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
toolStripStatusLabelusertime
.
Name
=
"toolStripStatusLabelusertime"
;
this
.
toolStripStatusLabelusertime
.
Size
=
new
System
.
Drawing
.
Size
(
20
0
,
27
);
this
.
toolStripStatusLabelusertime
.
Size
=
new
System
.
Drawing
.
Size
(
19
0
,
27
);
this
.
toolStripStatusLabelusertime
.
Text
=
"toolStripStatusLabel1"
;
//
// toolStripStatusLabelText
...
...
@@ -356,16 +357,17 @@
this
.
toolStripStatusLabelText
.
BorderSides
=
((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
)((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Left
|
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Right
)));
this
.
toolStripStatusLabelText
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
toolStripStatusLabelText
.
Name
=
"toolStripStatusLabelText"
;
this
.
toolStripStatusLabelText
.
Size
=
new
System
.
Drawing
.
Size
(
3
2
0
,
27
);
this
.
toolStripStatusLabelText
.
Size
=
new
System
.
Drawing
.
Size
(
3
0
0
,
27
);
this
.
toolStripStatusLabelText
.
Text
=
"toolStripStatusLabel1"
;
this
.
toolStripStatusLabelText
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
//
// HmiStatus
//
this
.
HmiStatus
.
AutoSize
=
false
;
this
.
HmiStatus
.
BorderSides
=
((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
)((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Left
|
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Right
)));
this
.
HmiStatus
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
HmiStatus
.
Name
=
"HmiStatus"
;
this
.
HmiStatus
.
Size
=
new
System
.
Drawing
.
Size
(
20
0
,
27
);
this
.
HmiStatus
.
Size
=
new
System
.
Drawing
.
Size
(
19
0
,
27
);
this
.
HmiStatus
.
Text
=
"HmiStatus"
;
this
.
HmiStatus
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
//
...
...
@@ -376,6 +378,7 @@
this
.
toolStripStatusLabelusertime
,
this
.
toolStripStatusLabelText
,
this
.
HmiStatus
,
this
.
AdjustStat
,
this
.
workProgress
});
this
.
statusStrip
.
Location
=
new
System
.
Drawing
.
Point
(
0
,
487
);
this
.
statusStrip
.
Name
=
"statusStrip"
;
...
...
@@ -383,6 +386,16 @@
this
.
statusStrip
.
TabIndex
=
2
;
this
.
statusStrip
.
Text
=
"StatusStrip"
;
//
// AdjustStat
//
this
.
AdjustStat
.
AutoSize
=
false
;
this
.
AdjustStat
.
BorderSides
=
((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
)((
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Left
|
System
.
Windows
.
Forms
.
ToolStripStatusLabelBorderSides
.
Right
)));
this
.
AdjustStat
.
Font
=
new
System
.
Drawing
.
Font
(
"Microsoft YaHei UI"
,
12F
);
this
.
AdjustStat
.
Name
=
"AdjustStat"
;
this
.
AdjustStat
.
Size
=
new
System
.
Drawing
.
Size
(
131
,
27
);
this
.
AdjustStat
.
Text
=
"toolStripStatusLabel1"
;
this
.
AdjustStat
.
TextAlign
=
System
.
Drawing
.
ContentAlignment
.
MiddleLeft
;
//
// workProgress
//
this
.
workProgress
.
Alignment
=
System
.
Windows
.
Forms
.
ToolStripItemAlignment
.
Right
;
...
...
@@ -461,6 +474,7 @@
private
System
.
Windows
.
Forms
.
ToolStripProgressBar
workProgress
;
private
System
.
Windows
.
Forms
.
Timer
timer2
;
private
System
.
Windows
.
Forms
.
ToolStripMenuItem
changeVsi
;
private
System
.
Windows
.
Forms
.
ToolStripStatusLabel
AdjustStat
;
}
}
...
...
GcDevicePc/MDIBase.cs
View file @
1085a985
...
...
@@ -800,6 +800,37 @@ namespace GcDevicePc
//Console.WriteLine(t2.ToString());
//下方状态显示
if
(
CKVocAnalyzer
.
GlobalCKV
.
FarNear
==
0
)
{
switch
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
)
{
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Zero
:
AdjustStat
.
Text
=
"近端校零"
;
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Biao
:
AdjustStat
.
Text
=
"近端校标"
;
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
:
AdjustStat
.
Text
=
"走样"
;
break
;
}
}
else
{
switch
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
)
{
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Zero
:
AdjustStat
.
Text
=
"远端校零"
;
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Biao
:
AdjustStat
.
Text
=
"远端校标"
;
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
:
AdjustStat
.
Text
=
"走样"
;
break
;
}
}
//监视界面活动
if
(
getIdleTick
()>
60
*
30
&&
LandIn
.
Island
)
...
...
@@ -1333,6 +1364,8 @@ namespace GcDevicePc
Connect_Status
.
Start
();
}
bool
isone_openos
=
false
;
/// <summary>
/// HMI状态监控线程实现
/// </summary>
...
...
@@ -1462,6 +1495,7 @@ namespace GcDevicePc
{
globaldata
.
IsStopOs
=
!
globaldata
.
IsStopOs
;
globaldata
.
OS_STOP
=
true
;
isone_openos
=
true
;
hmiopt
.
WriteEndVal
();
WaitHMIFree
();
(
this
.
title
.
Controls
.
Find
(
"pictureMenu1"
,
true
)[
0
]
as
PictureMenu
).
PMOptbtnstatus
=
0
;
...
...
@@ -1470,6 +1504,14 @@ namespace GcDevicePc
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
}
}
else
{
if
(
isone_openos
)
{
isone_openos
=
!
isone_openos
;
open
();
}
}
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
2
)
{
...
...
@@ -3025,6 +3067,21 @@ namespace GcDevicePc
SharedSpace
.
MControl
.
SetRun
=
true
;
//仪器进入校准环境
CurveDisPlay
.
forcePurge
=
true
;
//强制清除数据
AutoAdjust
=
DateTime
.
Now
.
AddSeconds
(
SharedSpace
.
MControl
.
dateend
);
switch
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
)
{
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Zero
:
hmiopt
.
Adjust_ling_biao
(
0
,
(
ushort
)
65280
);
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Biao
:
hmiopt
.
Adjust_ling_biao
(
1
,
(
ushort
)
65280
);
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
:
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
break
;
default
:
break
;
}
}
if
(
SharedSpace
.
MControl
.
MethodType
==
2
)
{
...
...
@@ -3032,26 +3089,24 @@ namespace GcDevicePc
SharedSpace
.
MControl
.
SetRun
=
true
;
//仪器进入校准环境
CurveDisPlay
.
forcePurge
=
true
;
AutoAdjust
=
DateTime
.
Now
.
AddSeconds
(
SharedSpace
.
MControl
.
dateend
);
switch
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
)
{
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Zero
:
hmiopt
.
Adjust_ling_biao
(
0
,
(
ushort
)
65280
);
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Biao
:
hmiopt
.
Adjust_ling_biao
(
1
,
(
ushort
)
65280
);
break
;
case
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
:
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
break
;
default
:
break
;
}
}
//switch (CKVocAnalyzer.GlobalCKV.adjustType)
//{
// case CKVocAnalyzer.GlobalCKV.AdjustType.AT_Zero:
// //hmiopt.Sw_RelayAdiust(0);
// //hmiopt.Sw_Samplegas((ushort)65280);
// hmiopt.Adjust_ling_biao(0, (ushort)65280);
// break;
// case CKVocAnalyzer.GlobalCKV.AdjustType.AT_Biao:
// //hmiopt.Sw_RelayAdiust(1);
// //hmiopt.Sw_Samplegas((ushort)65280);
// hmiopt.Adjust_ling_biao(1, (ushort)65280);
// break;
// case CKVocAnalyzer.GlobalCKV.AdjustType.AT_Yang:
// hmiopt.Adjust_ling_biao(0, 0);
// break;
// default:
// break;
//}
}
else
{
...
...
@@ -3080,6 +3135,11 @@ namespace GcDevicePc
{
CurveDisPlay
.
curdisp
.
ConfingAdjust
();
}
if
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
==
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
)
{
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
}
Trace
.
WriteLine
(
"校准结束"
,
"sys"
);
}
if
(
SharedSpace
.
MControl
.
MethodType
==
2
)
...
...
@@ -3090,12 +3150,14 @@ namespace GcDevicePc
{
CurveDisPlay
.
curdisp
.
ConfingAdjust
();
}
Trace
.
WriteLine
(
"校准结束"
,
"sys"
);
}
if
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
==
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
)
{
//
hmiopt.Adjust_ling_biao(0, 0);
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
}
Trace
.
WriteLine
(
"校准结束"
,
"sys"
);
}
}
if
(
SharedSpace
.
MControl
.
forceEnd
&&
SharedSpace
.
MControl
.
SetOut
&&
SharedSpace
.
MControl
.
SetRun
)
...
...
@@ -3108,6 +3170,11 @@ namespace GcDevicePc
SharedSpace
.
MControl
.
SetRun
=
false
;
SharedSpace
.
Data
.
typesint
=
0
;
Trace
.
WriteLine
(
"强制校准结束"
,
"sys"
);
if
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
==
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
)
{
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
}
}
if
(
SharedSpace
.
MControl
.
MethodType
==
2
)
{
...
...
@@ -3115,11 +3182,13 @@ namespace GcDevicePc
SharedSpace
.
MControl
.
SetRun
=
false
;
SharedSpace
.
Data
.
typesint
=
0
;
Trace
.
WriteLine
(
"强制校准结束"
,
"sys"
);
}
if
(
CKVocAnalyzer
.
GlobalCKV
.
adjustType
==
CKVocAnalyzer
.
GlobalCKV
.
AdjustType
.
AT_Yang
)
{
//hmiopt.Adjust_ling_biao(0, 0);
hmiopt
.
Adjust_ling_biao
(
0
,
0
);
}
}
}
globaldata
.
m_hmibuffer
.
gcadjust
.
runtime
=
(
long
)(
AutoAdjust
-
DateTime
.
Now
).
TotalSeconds
<
0
?
0
:
(
long
)(
AutoAdjust
-
DateTime
.
Now
).
TotalSeconds
;
...
...
GcDevicePc/ProThread/GcDataTh.cs
View file @
1085a985
...
...
@@ -984,6 +984,8 @@ namespace GcDevicePc.ProThread
{
bool
ret
=
false
;
UInt16
[]
hmistate
=
new
UInt16
[
9
];
UInt16
[]
epcdata
=
new
UInt16
[
16
];
ret
=
GetHMIState
(
ref
hmistate
);
if
(
ret
)
...
...
@@ -1015,7 +1017,43 @@ namespace GcDevicePc.ProThread
}
}
ret
=
GetEPCStatusData
(
ref
epcdata
);
if
(
ret
)
{
globaldata
.
m_hmibuffer
.
gcinfo
.
EPCStatus
=
epcdata
;
}
}
private
int
GetEPCHoldingReg
(
ushort
address
,
ushort
num
,
ref
UInt16
[]
state
)
{
int
ret
=
-
1
;
int
count
=
0
;
if
(
setflag
)
{
ret
=
globaldata
.
global_moudbus
.
ReadHoldingReg
(
address
,
num
,
this
.
strIP
,
this
.
netPost
,
ref
state
);
while
(
ret
!=
0
)
{
count
++;
if
(
count
>
3
)
break
;
ret
=
globaldata
.
global_moudbus
.
ReadHoldingReg
(
address
,
num
,
this
.
strIP
,
this
.
netPost
,
ref
state
);
}
}
return
ret
;
}
public
bool
GetEPCStatusData
(
ref
ushort
[]
data
)
{
int
ret
=
-
1
;
try
{
ret
=
GetEPCHoldingReg
(
700
,
16
,
ref
data
);
}
catch
(
Exception
e
)
{
Log
.
Error
(
e
.
Message
);
}
return
ret
==
0
;
}
/// <summary>
...
...
GcDevicePc/ProThread/HMIControl.cs
View file @
1085a985
...
...
@@ -23,7 +23,7 @@ namespace GcDevicePc.ProThread
this
.
strIP
=
ip
;
this
.
netPost
=
post
;
this
.
setflag
=
true
;
Monitorr1112Start
();
//
Monitorr1112Start();
}
else
{
...
...
@@ -232,11 +232,11 @@ namespace GcDevicePc.ProThread
int
count
=
0
;
if
(
this
.
setflag
)
{
ret
=
m_modbus
.
ReadCoilStatus
(
2
7
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
ret
=
m_modbus
.
ReadCoilStatus
(
2
6
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
ReadCoilStatus
(
2
7
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
ret
=
m_modbus
.
ReadCoilStatus
(
2
6
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
Thread
.
Sleep
(
200
);
if
(
count
==
3
)
break
;
...
...
@@ -286,11 +286,11 @@ namespace GcDevicePc.ProThread
{
ret
=
m_modbus
.
ReadCoilStatus
(
2
6
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
ret
=
m_modbus
.
ReadCoilStatus
(
2
7
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
ReadCoilStatus
(
2
6
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
ret
=
m_modbus
.
ReadCoilStatus
(
2
7
,
1
,
this
.
strIP
,
this
.
netPost
,
ref
nowdata
);
Thread
.
Sleep
(
200
);
if
(
count
==
3
)
break
;
...
...
@@ -307,21 +307,21 @@ namespace GcDevicePc.ProThread
writestatue
=
0
;
}
ret
=
m_modbus
.
WriteSingleCoil
(
2
6
,
writestatue
,
this
.
strIP
,
this
.
netPost
);
ret
=
m_modbus
.
WriteSingleCoil
(
2
7
,
writestatue
,
this
.
strIP
,
this
.
netPost
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
WriteSingleCoil
(
2
6
,
writestatue
,
this
.
strIP
,
this
.
netPost
);
ret
=
m_modbus
.
WriteSingleCoil
(
2
7
,
writestatue
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
ret
=
m_modbus
.
WriteSingleCoil
(
2
7
,
0
,
this
.
strIP
,
this
.
netPost
);
ret
=
m_modbus
.
WriteSingleCoil
(
2
6
,
0
,
this
.
strIP
,
this
.
netPost
);
while
(
ret
!=
0
)
{
count
++;
ret
=
m_modbus
.
WriteSingleCoil
(
2
7
,
0
,
this
.
strIP
,
this
.
netPost
);
ret
=
m_modbus
.
WriteSingleCoil
(
2
6
,
0
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
...
...
@@ -357,31 +357,6 @@ namespace GcDevicePc.ProThread
if
(
count
==
3
)
break
;
}
if
(
getrelaystat
(
26
)
!=
oc
)
{
bret
=
m_modbus
.
WriteSingleCoil
(
26
,
oc
,
this
.
strIP
,
this
.
netPost
);
while
(
bret
!=
0
)
{
count
++;
bret
=
m_modbus
.
WriteSingleCoil
(
26
,
oc
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
}
if
(
getrelaystat
(
27
)
!=
oc
)
{
bret
=
m_modbus
.
WriteSingleCoil
(
27
,
oc
,
this
.
strIP
,
this
.
netPost
);
while
(
bret
!=
0
)
{
count
++;
bret
=
m_modbus
.
WriteSingleCoil
(
27
,
oc
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
}
}
else
if
(
type
==
1
)
{
...
...
@@ -404,31 +379,6 @@ namespace GcDevicePc.ProThread
if
(
count
==
3
)
break
;
}
if
(
getrelaystat
(
27
)
!=
oc
)
{
bret
=
m_modbus
.
WriteSingleCoil
(
27
,
oc
,
this
.
strIP
,
this
.
netPost
);
while
(
bret
!=
0
)
{
count
++;
bret
=
m_modbus
.
WriteSingleCoil
(
27
,
oc
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
}
if
(
getrelaystat
(
26
)
!=
0
)
{
bret
=
m_modbus
.
WriteSingleCoil
(
26
,
0
,
this
.
strIP
,
this
.
netPost
);
while
(
bret
!=
0
)
{
count
++;
bret
=
m_modbus
.
WriteSingleCoil
(
26
,
0
,
this
.
strIP
,
this
.
netPost
);
Thread
.
Sleep
(
100
);
if
(
count
==
3
)
break
;
}
}
}
}
...
...
@@ -581,37 +531,6 @@ namespace GcDevicePc.ProThread
}
}
public
void
Sw_Samplegas
(
ushort
statue
)
{
int
ret
;
ushort
switchaddr
=
19
;
//ushort writestatue = 0;
byte
[]
nowdata
=
new
byte
[
1
];
int
count
=
0
;
////ret = m_modbus.ReadCoilStatus(switchaddr, 1, this.strIP, this.netPost, ref nowdata);
////while (ret != 0)
////{
//// count++;
//// ret = m_modbus.ReadCoilStatus(switchaddr, 1, this.strIP, this.netPost, ref nowdata);
//// Thread.Sleep(200);
//// if (count == 3)
//// break;
////}
////if (ret == 0)
{
//ret = m_modbus.WriteSingleCoil(switchaddr, statue, this.strIP, this.netPost);
//while (ret != 0)
//{
// count++;
// ret = m_modbus.WriteSingleCoil(switchaddr, statue, this.strIP, this.netPost);
// Thread.Sleep(100);
// if (count == 3)
// break;
//}
}
}
public
void
Sw_RelayAdiust
(
int
type
)
{
int
ret
;
...
...
GcDevicePc/Program.cs
View file @
1085a985
...
...
@@ -12,7 +12,7 @@ namespace GcDevicePc
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
bool
createNew
;
//Application.Run(new
TestForm
());
//Application.Run(new
ConfigMethod.FID
());
{
using
(
System
.
Threading
.
Mutex
mutex
=
new
System
.
Threading
.
Mutex
(
true
,
Application
.
ProductName
,
out
createNew
))
{
...
...
GcDevicePc/TestForm.Designer.cs
View file @
1085a985
...
...
@@ -37,6 +37,7 @@
this
.
button4
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button5
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button6
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
button7
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
SuspendLayout
();
//
// button1
...
...
@@ -51,7 +52,7 @@
//
// button2
//
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
250
,
36
4
);
this
.
button2
.
Location
=
new
System
.
Drawing
.
Point
(
128
,
31
4
);
this
.
button2
.
Name
=
"button2"
;
this
.
button2
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
23
);
this
.
button2
.
TabIndex
=
1
;
...
...
@@ -108,11 +109,22 @@
this
.
button6
.
Text
=
"button3"
;
this
.
button6
.
UseVisualStyleBackColor
=
true
;
//
// button7
//
this
.
button7
.
Location
=
new
System
.
Drawing
.
Point
(
244
,
314
);
this
.
button7
.
Name
=
"button7"
;
this
.
button7
.
Size
=
new
System
.
Drawing
.
Size
(
75
,
23
);
this
.
button7
.
TabIndex
=
4
;
this
.
button7
.
Text
=
"button7"
;
this
.
button7
.
UseVisualStyleBackColor
=
true
;
this
.
button7
.
Click
+=
new
System
.
EventHandler
(
this
.
Button7_Click
);
//
// 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
.
button7
);
this
.
Controls
.
Add
(
this
.
button6
);
this
.
Controls
.
Add
(
this
.
button5
);
this
.
Controls
.
Add
(
this
.
button4
);
...
...
@@ -136,5 +148,6 @@
private
System
.
Windows
.
Forms
.
Button
button4
;
private
System
.
Windows
.
Forms
.
Button
button5
;
private
System
.
Windows
.
Forms
.
Button
button6
;
private
System
.
Windows
.
Forms
.
Button
button7
;
}
}
\ No newline at end of file
GcDevicePc/TestForm.cs
View file @
1085a985
...
...
@@ -120,15 +120,6 @@ namespace GcDevicePc
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);
NModbusSlave
N
=
new
NModbusSlave
();
}
int
i
=
0
;
...
...
@@ -137,5 +128,10 @@ namespace GcDevicePc
i
++;
}
private
void
Button7_Click
(
object
sender
,
EventArgs
e
)
{
}
}
}
GcDevicePc/auxtool.Designer.cs
View file @
1085a985
...
...
@@ -124,6 +124,8 @@
this
.
firstfiredelay
.
Name
=
"firstfiredelay"
;
this
.
firstfiredelay
.
Size
=
new
System
.
Drawing
.
Size
(
100
,
21
);
this
.
firstfiredelay
.
TabIndex
=
10
;
this
.
firstfiredelay
.
KeyDown
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyDown
);
this
.
firstfiredelay
.
KeyUp
+=
new
System
.
Windows
.
Forms
.
KeyEventHandler
(
this
.
Text_KeyUp
);
//
// label14
//
...
...
GcDevicePc/auxtool.cs
View file @
1085a985
...
...
@@ -758,6 +758,37 @@ namespace GcDevicePc
adsw
(
0
);
}
private
double
lastnum
;
private
void
Text_KeyDown
(
object
sender
,
KeyEventArgs
e
)
{
if
(!
string
.
IsNullOrEmpty
((
sender
as
TextBox
).
Text
))
{
lastnum
=
Convert
.
ToDouble
((
sender
as
TextBox
).
Text
);
}
else
{
lastnum
=
0
;
}
}
private
void
Text_KeyUp
(
object
sender
,
KeyEventArgs
e
)
{
if
(!
string
.
IsNullOrEmpty
((
sender
as
TextBox
).
Text
))
{
double
nextnum
=
Convert
.
ToDouble
((
sender
as
TextBox
).
Text
);
if
(
nextnum
<
0
)
{
MessageBox
.
Show
(
"延时时间设置不能小于0"
);
(
sender
as
TextBox
).
Text
=
lastnum
.
ToString
();
}
if
(
nextnum
>
20
)
{
MessageBox
.
Show
(
"延时时间设置不能大于20"
);
(
sender
as
TextBox
).
Text
=
lastnum
.
ToString
();
}
}
}
//private void fireupbtnb_Click(object sender, EventArgs e)
//{
// if (String.IsNullOrEmpty(fireuptime.Text) || String.IsNullOrEmpty(hvalvetime.Text))
...
...
GcDevicePc/globaldata.cs
View file @
1085a985
...
...
@@ -126,6 +126,7 @@ namespace GcDevicePc
public
static
bool
newfile
=
false
;
public
static
bool
createfile
=
false
;
public
static
bool
usable
=
false
;
// public static Modbus m_modbus = new Modbus();
//public static UInt32 starttimer = 0x7FFFFFFF; //开始时间
...
...
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