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
edc81683
Commit
edc81683
authored
Jan 23, 2019
by
liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
仪器配置中仪器档次排序待验证
parent
592d4b65
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
660 additions
and
503 deletions
+660
-503
AppInit.cs
GcDevicePc/AppInit.cs
+21
-24
AdjustFrom.Designer.cs
GcDevicePc/CK_UI/AdjustFrom.Designer.cs
+1
-1
UserCtl.Designer.cs
GcDevicePc/CK_UI/UserCtl.Designer.cs
+10
-12
UserCtl.cs
GcDevicePc/CK_UI/UserCtl.cs
+42
-41
GCModbusSlave.cs
GcDevicePc/Common/GCModbusSlave.cs
+200
-191
FID.cs
GcDevicePc/ConfigMethod/FID.cs
+1
-1
IPPIP.cs
GcDevicePc/ConfigMethod/injectionport/IPPIP.cs
+2
-2
DataState.cs
GcDevicePc/DataState.cs
+120
-98
ConfigDevice.cs
GcDevicePc/DeviceConfigUI/ConfigDevice.cs
+37
-29
Device.Designer.cs
GcDevicePc/DeviceConfigUI/Device.Designer.cs
+1
-1
Device.cs
GcDevicePc/DeviceConfigUI/Device.cs
+2
-2
Formdebug.cs
GcDevicePc/Formdebug.cs
+0
-1
PCBuffer.cs
GcDevicePc/GCBuffer/PCBuffer.cs
+96
-50
GcDevicePc.csproj
GcDevicePc/GcDevicePc.csproj
+3
-2
MDIBase.cs
GcDevicePc/MDIBase.cs
+51
-28
CKvocUpdata.cs
GcDevicePc/ProThread/CKvocUpdata.cs
+5
-5
HMISearch.cs
GcDevicePc/ProThread/HMISearch.cs
+1
-1
UserConfig.cs
GcDevicePc/UserConfig.cs
+67
-14
CKVocAnalyzer.dll
dll/CKVocAnalyzer.dll
+0
-0
No files found.
GcDevicePc/AppInit.cs
View file @
edc81683
...
@@ -840,35 +840,32 @@ namespace GcDevicePc
...
@@ -840,35 +840,32 @@ namespace GcDevicePc
while
(
true
)
while
(
true
)
{
{
Thread
.
Sleep
(
3000
);
ret
=
mysearch
.
ThStart
();
if
(
globaldata
.
OffLinkMode
)
if
(
ret
)
{
{
globaldata
.
connection_ip
=
""
;
Thread
.
Sleep
(
3000
);
break
;
hmicount
=
mysearch
.
HMICount
();
if
(
hmicount
>=
1
)
{
ip
=
(((
globaldata
.
DeviceInfo
)(
mysearch
.
myHMIList
[
0
])).
IpAddr
);
globaldata
.
connection_ip
=
ip
;
mysearch
.
ThStop
();
break
;
}
mysearch
.
ThStop
();
}
}
else
else
{
{
ret
=
mysearch
.
ThStart
();
mysearch
.
ReGetHmiIp
();
Thread
.
Sleep
(
2000
);
if
(
ret
)
}
{
Thread
.
Sleep
(
3000
);
hmicount
=
mysearch
.
HMICount
();
if
(
hmicount
>=
1
)
{
ip
=
(((
globaldata
.
DeviceInfo
)(
mysearch
.
myHMIList
[
0
])).
IpAddr
);
globaldata
.
connection_ip
=
ip
;
mysearch
.
ThStop
();
break
;
}
mysearch
.
ThStop
();
}
if
(
globaldata
.
OffLinkMode
)
else
{
{
globaldata
.
connection_ip
=
""
;
mysearch
.
ReGetHmiIp
();
break
;
Thread
.
Sleep
(
2000
);
}
}
}
}
}
}
}
...
...
GcDevicePc/CK_UI/AdjustFrom.Designer.cs
View file @
edc81683
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
AutoScaleMode
=
System
.
Windows
.
Forms
.
AutoScaleMode
.
Font
;
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
722
,
382
);
this
.
ClientSize
=
new
System
.
Drawing
.
Size
(
971
,
426
);
this
.
Icon
=
((
System
.
Drawing
.
Icon
)(
resources
.
GetObject
(
"$this.Icon"
)));
this
.
Icon
=
((
System
.
Drawing
.
Icon
)(
resources
.
GetObject
(
"$this.Icon"
)));
this
.
Name
=
"AdjustFrom"
;
this
.
Name
=
"AdjustFrom"
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterScreen
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterScreen
;
...
...
GcDevicePc/CK_UI/UserCtl.Designer.cs
View file @
edc81683
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
textBox1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox3
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox3
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
textBox6
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox6
=
new
System
.
Windows
.
Forms
.
TextBox
();
...
@@ -44,6 +43,7 @@
...
@@ -44,6 +43,7 @@
this
.
textBox4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
textBox2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
.
SuspendLayout
();
this
.
groupBox1
.
SuspendLayout
();
this
.
SuspendLayout
();
this
.
SuspendLayout
();
//
//
...
@@ -102,15 +102,6 @@
...
@@ -102,15 +102,6 @@
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
29
);
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
29
);
this
.
textBox1
.
TabIndex
=
5
;
this
.
textBox1
.
TabIndex
=
5
;
this
.
textBox1
.
DoubleClick
+=
new
System
.
EventHandler
(
this
.
textBox1_DoubleClick
);
//
// textBox2
//
this
.
textBox2
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
14.25F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
textBox2
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
131
);
this
.
textBox2
.
Name
=
"textBox2"
;
this
.
textBox2
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
29
);
this
.
textBox2
.
TabIndex
=
6
;
//
//
// textBox3
// textBox3
//
//
...
@@ -203,6 +194,14 @@
...
@@ -203,6 +194,14 @@
this
.
timer1
.
Interval
=
60000
;
this
.
timer1
.
Interval
=
60000
;
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
this
.
timer1
.
Tick
+=
new
System
.
EventHandler
(
this
.
timer1_Tick
);
//
//
// textBox2
//
this
.
textBox2
.
Font
=
new
System
.
Drawing
.
Font
(
"宋体"
,
14.25F
,
System
.
Drawing
.
FontStyle
.
Bold
,
System
.
Drawing
.
GraphicsUnit
.
Point
,
((
byte
)(
134
)));
this
.
textBox2
.
Location
=
new
System
.
Drawing
.
Point
(
6
,
131
);
this
.
textBox2
.
Name
=
"textBox2"
;
this
.
textBox2
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
29
);
this
.
textBox2
.
TabIndex
=
6
;
//
// UserCtl
// UserCtl
//
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
@@ -225,7 +224,6 @@
...
@@ -225,7 +224,6 @@
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
TextBox
textBox1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox2
;
private
System
.
Windows
.
Forms
.
TextBox
textBox3
;
private
System
.
Windows
.
Forms
.
TextBox
textBox3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
...
@@ -235,6 +233,6 @@
...
@@ -235,6 +233,6 @@
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
TextBox
textBox4
;
private
System
.
Windows
.
Forms
.
TextBox
textBox4
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox2
;
}
}
}
}
GcDevicePc/CK_UI/UserCtl.cs
View file @
edc81683
...
@@ -56,9 +56,10 @@ namespace GcDevicePc.CK_UI
...
@@ -56,9 +56,10 @@ namespace GcDevicePc.CK_UI
{
{
try
try
{
{
Systemtype
=
CKVocAnalyzer
.
GlobalCKV
.
Systemtype
;
Systemtype
=
CKVocAnalyzer
.
GlobalCKV
.
Systemtype
;
isppm
=
false
;
groupBox1
.
Text
=
"结果(mg/m³)"
;
switch
(
Systemtype
)
switch
(
Systemtype
)
{
{
default
:
//非甲烷总烃
default
:
//非甲烷总烃
...
@@ -264,7 +265,7 @@ namespace GcDevicePc.CK_UI
...
@@ -264,7 +265,7 @@ namespace GcDevicePc.CK_UI
}
}
for
(
int
i
=
0
;
i
<
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
.
Count
;
i
++)
for
(
int
i
=
0
;
i
<
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
.
Count
;
i
++)
{
{
if
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
Name
==
CKVocAnalyzer
.
GlobalCKV
.
IngredientList
[
0
].
name
)
if
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
Name
==
CKVocAnalyzer
.
GlobalCKV
.
IngredientList
[
0
].
name
)
{
{
...
@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI
...
@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI
textBox1
.
Text
=
Math
.
Round
(
listNmoc
[
listNmoc
.
Count
-
1
].
Y
,
2
).
ToString
()
+
"ppm"
;
textBox1
.
Text
=
Math
.
Round
(
listNmoc
[
listNmoc
.
Count
-
1
].
Y
,
2
).
ToString
()
+
"ppm"
;
}
}
else
else
{
{
//此处计算成mg/m3 nmhc
textBox1
.
Text
=
Math
.
Round
(
listNmoc
[
listNmoc
.
Count
-
1
].
Y
/
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
MWeight
/
12
)
*
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
MWeight
/
22.4
),
2
).
ToString
()
+
"mg/m³"
;
textBox1
.
Text
=
Math
.
Round
(
listNmoc
[
listNmoc
.
Count
-
1
].
Y
/
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
MWeight
/
12
)
*
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
MWeight
/
22.4
),
2
).
ToString
()
+
"mg/m³"
;
}
}
...
@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI
...
@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI
}
}
else
else
textBox2
.
BackColor
=
zcolor
;
textBox2
.
BackColor
=
zcolor
;
}
}
if
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
Name
==
CKVocAnalyzer
.
GlobalCKV
.
IngredientList
[
2
].
name
)
if
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
Name
==
CKVocAnalyzer
.
GlobalCKV
.
IngredientList
[
2
].
name
)
...
@@ -322,10 +325,8 @@ namespace GcDevicePc.CK_UI
...
@@ -322,10 +325,8 @@ namespace GcDevicePc.CK_UI
else
else
textBox3
.
BackColor
=
zcolor
;
textBox3
.
BackColor
=
zcolor
;
}
}
}
}
...
@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI
...
@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI
}
}
private
void
textBox1_DoubleClick
(
object
sender
,
EventArgs
e
)
//
private void textBox1_DoubleClick(object sender, EventArgs e)
{
//
{
isppm
=
!
isppm
;
//
isppm = !isppm;
if
(
isppm
)
//
if(isppm)
{
//
{
groupBox1
.
Text
=
"结果(ppm)"
;
//
groupBox1.Text = "结果(ppm)";
}
else
//
}else
groupBox1
.
Text
=
"结果(mg/m³)"
;
//
groupBox1.Text = "结果(mg/m³)";
try
//
try
{
//
{
switch
(
Systemtype
)
//
switch (Systemtype)
{
//
{
default
:
//非甲烷总烃
//
default: //非甲烷总烃
data
();
//
data();
datadisp
();
//
datadisp();
UIVisible
(
false
);
//
UIVisible(false);
break
;
//
break;
case
1
:
//
case 1:
data2
();
//
data2();
datadisp2
();
//
datadisp2();
break
;
//
break;
}
//
}
// Trace.WriteLine("绘图","sys");
//
// Trace.WriteLine("绘图","sys");
}
//
}
catch
(
Exception
ex
)
//
catch (Exception ex)
{
//
{
Trace
.
Write
(
ex
);
//
Trace.Write(ex);
}
//
}
}
//
}
}
}
}
}
GcDevicePc/Common/GCModbusSlave.cs
View file @
edc81683
...
@@ -91,266 +91,275 @@ namespace GcDevicePc.Common
...
@@ -91,266 +91,275 @@ namespace GcDevicePc.Common
static
ushort
slavereadhreg
(
ushort
address
)
static
ushort
slavereadhreg
(
ushort
address
)
{
{
ushort
value
=
0
;
try
ushort
signalddress
=
17
;
ushort
baseaddress
=
23
;
address
=
(
ushort
)(
address
-
1
);
int
listnum
=
SharedSpace
.
Data
.
listValue
.
Count
;
if
(
address
>=
17
)
{
{
ushort
[]
s
=
new
ushort
[
2
];
ushort
value
=
0
;
float
[]
f
=
new
float
[
2
];
ushort
signalddress
=
17
;
ushort
baseaddress
=
23
;
if
(
address
>=
17
&&
address
<=
22
)
//信号输出
address
=
(
ushort
)(
address
-
1
);
{
int
listnum
=
SharedSpace
.
Data
.
listValue
.
Count
;
if
(
address
==
17
||
address
==
18
)
if
(
address
>=
17
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
.
ToString
(
"0.000"
));
if
(
address
==
19
||
address
==
20
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
iDetValue
.
ToString
(
"0.000"
));
if
(
address
==
21
||
address
==
22
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
bDetValue
.
ToString
(
"0.000"
));
Buffer
.
BlockCopy
(
f
,
2
,
s
,
0
,
2
);
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
value
=
s
[(
address
-
signalddress
)
%
2
];
}
else
if
(
address
>=
23
&&
listnum
>
0
)
//组分输出
{
{
int
readnum
=
(
address
-
baseaddress
)
/
2
;
ushort
[]
s
=
new
ushort
[
2
];
if
(
readnum
<=
listnum
-
1
)
float
[]
f
=
new
float
[
2
];
if
(
address
>=
17
&&
address
<=
22
)
//信号输出
{
{
f
[
0
]
=
float
.
Parse
(
SharedSpace
.
Data
.
listValue
[
readnum
].
vale
.
ToString
());
if
(
address
==
17
||
address
==
18
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetValue
.
ToString
(
"0.000"
));
if
(
address
==
19
||
address
==
20
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
iDetValue
.
ToString
(
"0.000"
));
if
(
address
==
21
||
address
==
22
)
f
[
0
]
=
float
.
Parse
(
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
bDetValue
.
ToString
(
"0.000"
));
Buffer
.
BlockCopy
(
f
,
2
,
s
,
0
,
2
);
Buffer
.
BlockCopy
(
f
,
2
,
s
,
0
,
2
);
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
value
=
s
[(
address
-
baseaddress
)
%
2
];
value
=
s
[(
address
-
signalddress
)
%
2
];
}
else
if
(
address
>=
23
&&
listnum
>
0
)
//组分输出
{
int
readnum
=
(
address
-
baseaddress
)
/
2
;
if
(
readnum
<=
listnum
-
1
)
{
f
[
0
]
=
float
.
Parse
(
SharedSpace
.
Data
.
listValue
[
readnum
].
vale
.
ToString
());
Buffer
.
BlockCopy
(
f
,
2
,
s
,
0
,
2
);
Buffer
.
BlockCopy
(
f
,
0
,
s
,
2
,
2
);
value
=
s
[(
address
-
baseaddress
)
%
2
];
}
else
{
value
=
0
;
}
}
}
else
else
{
{
value
=
0
;
value
=
0
;
}
}
}
}
else
//分析仪状态
if
(
address
>=
1
&&
address
<
20
)
{
{
value
=
0
;
switch
(
address
)
}
}
//分析仪状态
if
(
address
>=
1
&&
address
<
20
)
{
switch
(
address
)
{
case
1
:
//进度
{
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
1
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
2
)
case
1
:
//进度
{
if
(
SharedSpace
.
MControl
.
dateend
!=
0
&&
SharedSpace
.
MControl
.
zhouqi
!=
0
)
{
{
value
=
(
ushort
)
((
globaldata
.
m_hmibuffer
.
gcinfo
.
batruncount
*
1.0f
)
/
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
1
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
2
)
(
ushort
)
(
SharedSpace
.
MControl
.
dateend
*
1.0f
/
{
SharedSpace
.
MControl
.
zhouqi
)
*
1000
);
if
(
SharedSpace
.
MControl
.
dateend
!=
0
&&
SharedSpace
.
MControl
.
zhouqi
!=
0
)
{
value
=
(
ushort
)((
globaldata
.
m_hmibuffer
.
gcinfo
.
batruncount
*
1.0f
)
/
(
ushort
)(
SharedSpace
.
MControl
.
dateend
*
1.0f
/
SharedSpace
.
MControl
.
zhouqi
)
*
1000
);
}
else
{
value
=
0
;
}
}
else
{
value
=
0
;
}
}
}
else
break
;
case
2
:
// 0-正在采样(默认) 1-手动 2-定时 3-校准成功 4-校准失败 5-校准成功(正在采样) 6-校准失败(正在采样)
{
{
value
=
0
;
if
(!
SharedSpace
.
MControl
.
SetOut
&&
!
SharedSpace
.
MControl
.
SetRun
)
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
value
=
5
;
else
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
4
)
value
=
6
;
else
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
else
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
}
}
break
;
}
case
3
:
else
{
value
=
0
;
}
}
break
;
case
2
:
// 0-正在采样(默认) 1-手动 2-定时 3-校准成功 4-校准失败 5-校准成功(正在采样) 6-校准失败(正在采样)
{
if
(!
SharedSpace
.
MControl
.
SetOut
&&
!
SharedSpace
.
MControl
.
SetRun
)
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
value
=
5
;
else
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
4
)
value
=
6
;
else
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
else
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
}
break
;
case
3
:
{
value
=
SharedSpace
.
Data
.
change
==
true
?
(
ushort
)
1
:
(
ushort
)
0
;
}
break
;
case
4
:
{
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
0
];
}
break
;
case
5
:
{
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
1
];
}
break
;
case
6
:
{
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
2
];
}
break
;
case
7
:
//设备联机状态
{
value
=
(
ushort
)(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmioffline
?
1
:
0
);
}
break
;
case
8
:
//HMI状态
{
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
;
}
break
;
case
9
:
//前进样口
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
*
10
)
;
value
=
SharedSpace
.
Data
.
change
==
true
?
(
ushort
)
1
:
(
ushort
)
0
;
}
}
else
break
;
case
4
:
{
{
value
=
0
;
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
0
]
;
}
}
}
break
;
break
;
case
5
:
case
10
:
//后进样口
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
*
10
)
;
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
1
]
;
}
}
else
break
;
case
6
:
{
{
value
=
0
;
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
HMIMac
[
2
]
;
}
}
}
break
;
break
;
case
7
:
//设备联机状态
case
11
:
// 柱箱
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_
dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
*
1
0
);
value
=
(
ushort
)(
globaldata
.
m_
hmibuffer
.
gcinfo
.
hmioffline
?
1
:
0
);
}
}
else
break
;
case
8
:
//HMI状态
{
{
value
=
0
;
value
=
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
;
}
}
}
break
;
break
;
case
9
:
//前进样口
case
12
:
//前检测器
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16
DetFrontType
==
0
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16
InjPortFront
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
*
10
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
}
}
else
else
{
{
value
=
0
;
value
=
0
;
}
}
}
}
else
break
;
{
case
10
:
//后进样口
value
=
0
;
}
}
break
;
case
13
:
//中检测器
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
)
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDet
ActualTemp
*
10
);
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BP
ActualTemp
*
10
);
}
}
else
else
{
{
value
=
0
;
value
=
0
;
}
}
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
break
;
case
11
:
// 柱箱
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
*
10
);
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
}
else
{
value
=
0
;
}
}
break
;
case
14
:
//后检测器
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
)
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDet
ActualTemp
*
10
);
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
Col
ActualTemp
*
10
);
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
else
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
)
;
value
=
0
;
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
}
break
;
case
12
:
//前检测器
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
{
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
*
10
);
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
0
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
*
10
);
}
else
{
value
=
0
;
}
}
}
else
else
{
{
value
=
0
;
value
=
0
;
}
}
}
}
else
break
;
case
13
:
//中检测器
{
{
value
=
0
;
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
)
}
{
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
break
;
{
case
15
:
//前点火信号
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
{
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
{
value
=
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetStatue
;
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
*
10
);
}
else
{
value
=
0
;
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
*
10
);
}
else
{
value
=
0
;
}
}
}
else
break
;
case
14
:
//后检测器
{
{
value
=
0
;
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
)
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
*
10
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
{
value
=
(
ushort
)(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
*
10
);
}
else
{
value
=
0
;
}
}
else
{
value
=
0
;
}
}
}
}
break
;
break
;
case
15
:
//前点火信号
case
16
:
//后点火信号
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
{
value
=
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetStatue
;
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
value
=
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetStatue
;
}
else
{
value
=
0
;
}
}
}
else
break
;
case
16
:
//后点火信号
{
{
value
=
0
;
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
value
=
globaldata
.
m_dpbuffer
.
ShowList
.
showDet
.
fDetStatue
;
}
else
{
value
=
0
;
}
}
}
}
break
;
break
;
}
}
}
return
value
;
}
}
return
value
;
catch
(
Exception
e
)
{
Console
.
WriteLine
(
"异常"
+
e
.
Message
);
return
0
;
}
}
}
//static ushort slavereadhreg(ushort address)
//static ushort slavereadhreg(ushort address)
//{
//{
// ushort value = 0;
// ushort value = 0;
...
...
GcDevicePc/ConfigMethod/FID.cs
View file @
edc81683
...
@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod
...
@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod
this
.
methodconfig
.
GetFidByID
(
index
);
this
.
methodconfig
.
GetFidByID
(
index
);
fidsettemp
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fHeaterTempSet
.
ToString
();
fidsettemp
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fHeaterTempSet
.
ToString
();
if
(
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
hwconfig
.
hwconfiginfo
.
u16StartType
==
2
)
if
(
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
hwconfig
.
hwconfiginfo
.
u16StartType
==
3
)
{
{
tb
氢气压力设定
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fSetH2Flow
.
ToString
();
tb
氢气压力设定
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fSetH2Flow
.
ToString
();
tb
空气压力设定
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fAirFlowSet
.
ToString
();
tb
空气压力设定
.
Text
=
this
.
methodconfig
.
fid
[
index
].
fAirFlowSet
.
ToString
();
...
...
GcDevicePc/ConfigMethod/injectionport/IPPIP.cs
View file @
edc81683
...
@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
...
@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
txtHeater
.
Text
=
this
.
methodconfig
.
port
[
index
].
HeaterTmpActual
.
ToString
();
txtHeater
.
Text
=
this
.
methodconfig
.
port
[
index
].
HeaterTmpActual
.
ToString
();
if
(
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
2
)
if
(
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
3
)
{
{
txtFlow
.
Text
=
this
.
methodconfig
.
port
[
index
].
pipFlowActual
.
ToString
();
txtFlow
.
Text
=
this
.
methodconfig
.
port
[
index
].
pipFlowActual
.
ToString
();
txtPressure
.
Text
=
this
.
methodconfig
.
port
[
index
].
pipPressureActual
.
ToString
();
txtPressure
.
Text
=
this
.
methodconfig
.
port
[
index
].
pipPressureActual
.
ToString
();
...
@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
...
@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
label21
.
Text
=
"辅助载气类型:"
;
label21
.
Text
=
"辅助载气类型:"
;
if
(
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
2
)
if
(
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
1
||
this
.
hwconfig
.
hwconfiginfo
.
u16StartType
==
3
)
{
{
txtFlow
.
Text
=
this
.
methodconfig
.
auxs
[
index
].
pipFlowActual
.
ToString
();
txtFlow
.
Text
=
this
.
methodconfig
.
auxs
[
index
].
pipFlowActual
.
ToString
();
txtPressure
.
Text
=
this
.
methodconfig
.
auxs
[
index
].
pipPressureActual
.
ToString
();
txtPressure
.
Text
=
this
.
methodconfig
.
auxs
[
index
].
pipPressureActual
.
ToString
();
...
...
GcDevicePc/DataState.cs
View file @
edc81683
...
@@ -1127,42 +1127,58 @@ namespace GcDevicePc
...
@@ -1127,42 +1127,58 @@ namespace GcDevicePc
//前进样口
//前进样口
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortFront
==
1
)
{
{
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
"前进样口"
;
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPSetTemp
==
0.0f
)
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPSetTemp
!=
0.0f
)
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
)
+
" / "
+
"未定义"
);
{
else
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
"前进样口"
;
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPSetTemp
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
FPSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
//else
//{
// //tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.FPActualTemp) + " / " + "未定义");
//}
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16InjPortBehind
==
1
)
{
{
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
"后进样口"
;
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPSetTemp
==
0.0f
)
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPSetTemp
!=
0.0f
)
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
)
+
" / "
+
"未定义"
);
{
else
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
"后进样口"
;
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPSetTemp
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
BPSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.BPActualTemp) + " / " + "未定义");
//else
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16Col
==
1
)
{
{
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
"柱箱"
;
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColSetTemp
!=
0.0f
)
{
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColSetTemp
==
0.0f
)
tempshow
=
new
ListViewItem
();
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
)
+
" / "
+
"未定义"
)
;
tempshow
.
Text
=
"柱箱"
;
else
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.ColActualTemp) + " / " + "未定义");
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColSetTemp
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
ColSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
//else
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
...
@@ -1170,88 +1186,87 @@ namespace GcDevicePc
...
@@ -1170,88 +1186,87 @@ namespace GcDevicePc
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFront
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFront
==
1
)
{
{
tempshow
=
new
ListViewItem
();
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetSetTemp
!=
0.0f
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
0
)
//TCD
{
tempshow
.
Text
=
"TCD1"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
{
tempshow
.
Text
=
"FID1"
;
tempshow
=
new
ListViewItem
();
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
0
)
//TCD
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
3
)
{
{
tempshow
.
Text
=
"FPD1"
;
}
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetSetTemp
==
0.0f
)
tempshow
.
Text
=
"TCD1"
;
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
)
+
" / "
+
"未定义"
);
}
else
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
1
)
{
tempshow
.
Text
=
"FID1"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetFrontType
==
3
)
{
tempshow
.
Text
=
"FPD1"
;
}
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetSetTemp
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
fDetSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.fDetActualTemp) + " / " + "未定义");
//else
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
&&
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
!=
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInter
==
1
&&
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
!=
1
)
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
//TCD
{
tempshow
.
Text
=
"TCD2"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
tempshow
.
Text
=
"FID2"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
3
)
{
tempshow
.
Text
=
"FPD2"
;
}
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetSetTemp
==
0.0f
)
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetSetTemp
!=
0.0f
)
{
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
)
+
" / "
+
"未定义"
);
}
else
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
0
)
//TCD
{
tempshow
.
Text
=
"TCD2"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
1
)
{
tempshow
.
Text
=
"FID2"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetInterType
==
3
)
{
tempshow
.
Text
=
"FPD2"
;
}
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetSetTemp
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
iDetSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.iDetActualTemp) + " / " + "未定义");
}
}
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
&&
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
!=
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehind
==
1
&&
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
!=
1
)
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
{
tempshow
.
Text
=
"TCD3"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
{
tempshow
.
Text
=
"FID3"
;
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
3
)
{
tempshow
.
Text
=
"FPD3"
;
}
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetSetTemp
=
=
0.0f
)
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetSetTemp
!
=
0.0f
)
{
{
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
)
+
" / "
+
"未定义"
);
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.bDetActualTemp) + " / " + "未定义");
}
tempshow
=
new
ListViewItem
();
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
0
)
{
{
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetSetTemp
.
ToString
(
"0"
));
tempshow
.
Text
=
"TCD3"
;
}
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
1
)
{
tempshow
.
Text
=
"FID3"
;
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
else
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16DetBehindType
==
3
)
{
tempshow
.
Text
=
"FPD3"
;
}
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetActualTemp
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
bDetSetTemp
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
}
}
}
...
@@ -1259,38 +1274,45 @@ namespace GcDevicePc
...
@@ -1259,38 +1274,45 @@ namespace GcDevicePc
{
{
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
//TCD
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater1
==
1
)
//TCD
{
{
tempshow
=
new
ListViewItem
();
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp1
!=
0.0f
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName1
!=
null
)
tempshow
.
Text
=
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName1
;
else
tempshow
.
Text
=
"未命名"
;
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp1
==
0.0f
)
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
)
+
" / "
+
"未定义"
);
else
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName1
!=
null
)
tempshow
.
Text
=
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName1
;
else
tempshow
.
Text
=
"未命名"
;
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp1
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp1
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp1
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp1) + " / " + "未定义");
//else
//{
//}
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeater2
==
1
)
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName2
!=
null
)
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp2
!=
0.0f
)
tempshow
.
Text
=
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName2
;
else
tempshow
.
Text
=
"未命名"
;
if
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp2
==
0.0f
)
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
)
+
" / "
+
"未定义"
);
else
{
{
tempshow
=
new
ListViewItem
();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName2
!=
null
)
tempshow
.
Text
=
CProfileDevice
.
m_DevParam
.
syspara
.
u16AuxHeaterName2
;
else
tempshow
.
Text
=
"未命名"
;
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp2
.
ToString
(
"0"
));
tempshow
.
SubItems
.
Add
(
IsException
(
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxActualTemp2
)
+
" / "
+
globaldata
.
m_dpbuffer
.
ShowList
.
showtemp
.
AuxSetTemp2
.
ToString
(
"0"
));
this
.
datalist
.
Items
.
Add
(
tempshow
);
}
}
this
.
datalist
.
Items
.
Add
(
tempshow
);
//tempshow.SubItems.Add(IsException(globaldata.m_dpbuffer.ShowList.showtemp.AuxActualTemp2) + " / " + "未定义");
//else
//{
//}
//if (CProfileDevice.m_DevParam.aux.fSetTemp_HeatArea2 == 0.0f)
//if (CProfileDevice.m_DevParam.aux.fSetTemp_HeatArea2 == 0.0f)
...
@@ -1505,7 +1527,7 @@ namespace GcDevicePc
...
@@ -1505,7 +1527,7 @@ namespace GcDevicePc
this
.
datalist
.
Items
.
Add
(
tempshow
);
this
.
datalist
.
Items
.
Add
(
tempshow
);
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
2
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
3
)
{
{
tempshow
=
new
ListViewItem
();
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
GettempName
(
"氢气流量(mL/min)"
);
tempshow
.
Text
=
GettempName
(
"氢气流量(mL/min)"
);
...
@@ -1822,7 +1844,7 @@ namespace GcDevicePc
...
@@ -1822,7 +1844,7 @@ namespace GcDevicePc
this
.
datalist
.
Items
.
Add
(
tempshow
);
this
.
datalist
.
Items
.
Add
(
tempshow
);
//tempshow = new ListViewItem();
//tempshow = new ListViewItem();
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
1
||
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
2
)
if
(
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
1
||
CProfileDevice
.
m_DevParam
.
syspara
.
u16StartType
==
3
)
{
{
tempshow
=
new
ListViewItem
();
tempshow
=
new
ListViewItem
();
tempshow
.
Text
=
GettempName
(
"载气流量"
);
tempshow
.
Text
=
GettempName
(
"载气流量"
);
...
...
GcDevicePc/DeviceConfigUI/ConfigDevice.cs
View file @
edc81683
...
@@ -333,39 +333,47 @@ namespace GcDevicePc.DeviceConfigUI
...
@@ -333,39 +333,47 @@ namespace GcDevicePc.DeviceConfigUI
#
region
控件事件
#
region
控件事件
private
void
HMIConfigTree_NodeMouseDoubleClick
(
object
sender
,
TreeNodeMouseClickEventArgs
e
)
private
void
HMIConfigTree_NodeMouseDoubleClick
(
object
sender
,
TreeNodeMouseClickEventArgs
e
)
{
{
if
(
e
.
Button
==
MouseButtons
.
Right
||
e
.
Node
.
Level
==
0
)
try
return
;
int
nodename
=
int
.
Parse
(
HMIConfigTree
.
SelectedNode
.
Tag
.
ToString
());
if
(
nodename
>
0
&&
nodename
<
24
)
{
{
if
(
nodename
<=
3
)
if
(
e
.
Button
==
MouseButtons
.
Right
||
e
.
Node
.
Level
==
0
)
{
return
;
Device
device
=
new
Device
(
ref
hWConfig
);
device
.
ShowDialog
();
int
nodename
=
int
.
Parse
(
HMIConfigTree
.
SelectedNode
.
Tag
.
ToString
());
}
if
(
nodename
>
0
&&
nodename
<
24
)
else
if
(
nodename
<=
15
)
{
Sampling
sampling
=
new
Sampling
(
ref
hWConfig
,
nodename
);
sampling
.
ShowDialog
();
}
else
if
(
nodename
<=
18
)
{
ColumnBox
columnBox
=
new
ColumnBox
(
ref
hWConfig
);
columnBox
.
ShowDialog
();
}
else
if
(
nodename
<=
21
)
{
Detection
detection
=
new
Detection
(
ref
hWConfig
);
detection
.
ShowDialog
();
}
else
{
{
Auxiliary
auxiliary
=
new
Auxiliary
(
ref
hWConfig
);
if
(
nodename
<=
3
)
auxiliary
.
ShowDialog
();
{
}
Device
device
=
new
Device
(
ref
hWConfig
);
device
.
ShowDialog
();
}
else
if
(
nodename
<=
15
)
{
Sampling
sampling
=
new
Sampling
(
ref
hWConfig
,
nodename
);
sampling
.
ShowDialog
();
}
else
if
(
nodename
<=
18
)
{
ColumnBox
columnBox
=
new
ColumnBox
(
ref
hWConfig
);
columnBox
.
ShowDialog
();
}
else
if
(
nodename
<=
21
)
{
Detection
detection
=
new
Detection
(
ref
hWConfig
);
detection
.
ShowDialog
();
}
else
{
Auxiliary
auxiliary
=
new
Auxiliary
(
ref
hWConfig
);
auxiliary
.
ShowDialog
();
}
}
}
}
catch
{
}
}
}
/// <summary>
/// <summary>
...
...
GcDevicePc/DeviceConfigUI/Device.Designer.cs
View file @
edc81683
...
@@ -61,8 +61,8 @@
...
@@ -61,8 +61,8 @@
//
//
this
.
StartType
.
FormattingEnabled
=
true
;
this
.
StartType
.
FormattingEnabled
=
true
;
this
.
StartType
.
Items
.
AddRange
(
new
object
[]
{
this
.
StartType
.
Items
.
AddRange
(
new
object
[]
{
"机械阀"
,
"进样EPC"
,
"进样EPC"
,
"机械阀"
,
"全EPC"
});
"全EPC"
});
this
.
StartType
.
Location
=
new
System
.
Drawing
.
Point
(
157
,
143
);
this
.
StartType
.
Location
=
new
System
.
Drawing
.
Point
(
157
,
143
);
this
.
StartType
.
Name
=
"StartType"
;
this
.
StartType
.
Name
=
"StartType"
;
...
...
GcDevicePc/DeviceConfigUI/Device.cs
View file @
edc81683
...
@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI
...
@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI
{
{
this
.
GCNum
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCNum
;
this
.
GCNum
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCNum
;
this
.
GCName
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCName
;
this
.
GCName
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCName
;
this
.
StartType
.
SelectedIndex
=
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
;
this
.
StartType
.
SelectedIndex
=
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
-
1
;
}
}
}
}
catch
catch
...
@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI
...
@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI
{
{
this
.
hWConfig
.
hwconfiginfo
.
GCNum
=
this
.
GCNum
.
Text
;
this
.
hWConfig
.
hwconfiginfo
.
GCNum
=
this
.
GCNum
.
Text
;
this
.
hWConfig
.
hwconfiginfo
.
GCName
=
this
.
GCName
.
Text
;
this
.
hWConfig
.
hwconfiginfo
.
GCName
=
this
.
GCName
.
Text
;
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
=
this
.
StartType
.
SelectedIndex
;
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
=
this
.
StartType
.
SelectedIndex
+
1
;
}
}
this
.
Close
();
this
.
Close
();
}
}
...
...
GcDevicePc/Formdebug.cs
View file @
edc81683
...
@@ -36,7 +36,6 @@ namespace GcDevicePc
...
@@ -36,7 +36,6 @@ namespace GcDevicePc
dataleft
.
CloseButtonVisible
=
false
;
dataleft
.
CloseButtonVisible
=
false
;
//dataleft.Close_Threading();
//dataleft.Close_Threading();
//dataleft.Close();
//dataleft.Close();
}
}
public
void
CloseThread
()
public
void
CloseThread
()
...
...
GcDevicePc/GCBuffer/PCBuffer.cs
View file @
edc81683
using
System
;
using
GcDevicePc.Common
;
using
Ini.Net
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.IO
;
using
System.IO
;
using
System.Linq
;
using
System.Linq
;
...
@@ -116,74 +118,118 @@ namespace GcDevicePc.GCBuffer
...
@@ -116,74 +118,118 @@ namespace GcDevicePc.GCBuffer
gcpcinfo
.
outputinfo
.
port
=
0
;
gcpcinfo
.
outputinfo
.
port
=
0
;
//string file = System.Windows.Forms.Application.StartupPath+ "\\startup.ini";
//string file = System.Windows.Forms.Application.StartupPath+ "\\..\\GC_Config\\GC_Set\\启动参数" + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
if
(
File
.
Exists
(
file
))
try
{
{
INIOperation
test
=
new
INIOperation
(
file
)
;
//string file = System.Windows.Forms.Application.StartupPath+ "\\startup.ini"
;
string
opensys
=
test
.
INIGetStringValue
(
"StartUp"
,
"打开系统"
,
null
)
;
//string file = System.Windows.Forms.Application.StartupPath+ "\\..\\GC_Config\\GC_Set\\启动参数" + "\\startup.ini"
;
string
runtype
=
test
.
INIGetStringValue
(
"StartUp"
,
"运行类型"
,
null
);
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
string
wtd624x_ip
=
test
.
INIGetStringValue
(
"WTD624X"
,
"IP"
,
null
);
if
(
File
.
Exists
(
file
))
string
wtd624x_mask
=
test
.
INIGetStringValue
(
"WTD624X"
,
"MASK"
,
null
);
{
string
wtd624x_gw
=
test
.
INIGetStringValue
(
"WTD624X"
,
"GW"
,
null
);
IniFile
ini
=
new
IniFile
(
file
);
int
opensys
=
ini
.
ReadInteger
(
"StartUp"
,
"打开系统"
);
int
runtype
=
ini
.
ReadInteger
(
"StartUp"
,
"运行类型"
);
int
senddata
=
ini
.
ReadInteger
(
"StartUp"
,
"SendData"
);
gcpcinfo
.
pcfolderinfo
.
DataFolder
=
ini
.
ReadString
(
"DataFolder"
,
"历史数据"
);
string
info_log
=
test
.
INIGetStringValue
(
"Logs"
,
"InfoLog"
,
null
);
gcpcinfo
.
pcworkinfo
.
hmimac
=
ini
.
ReadString
(
"NetWorkConfig"
,
"MAC地址"
);
string
err_log
=
test
.
INIGetStringValue
(
"Logs"
,
"ErrLog"
,
null
);
string
hmi_log
=
test
.
INIGetStringValue
(
"Logs"
,
"HmiLog"
,
null
);
if
(
opensys
==
1
)
{
gcpcinfo
.
pcworkinfo
.
RunType
=
(
ushort
)
runtype
;
}
else
{
gcpcinfo
.
pcworkinfo
.
RunType
=
0
;
}
string
gc485
=
test
.
INIGetStringValue
(
"GC485"
,
"COM"
,
null
);
if
(
senddata
==
1
)
{
gcpcinfo
.
pcworkinfo
.
sendtohw
=
true
;
}
else
{
gcpcinfo
.
pcworkinfo
.
sendtohw
=
false
;
}
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
//INIOperation test = new INIOperation(file);
//string opensys = test.INIGetStringValue("StartUp", "打开系统", null);
//string runtype = test.INIGetStringValue("StartUp", "运行类型", null);
if
(
Convert
.
ToInt32
(
opensys
)
==
1
)
string
wtd624x_ip
=
ini
.
ReadString
(
"WTD624X"
,
"IP"
);
{
string
wtd624x_mask
=
ini
.
ReadString
(
"WTD624X"
,
"MASK"
);
gcpcinfo
.
pcworkinfo
.
RunType
=
Convert
.
ToUInt16
(
runtype
);
string
wtd624x_gw
=
ini
.
ReadString
(
"WTD624X"
,
"GW"
);
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_ip
))
{
gcpcinfo
.
moduleinfo
.
ip
=
wtd624x_ip
;
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_mask
))
string
info_log
=
ini
.
ReadString
(
"Logs"
,
"InfoLog"
);
{
string
err_log
=
ini
.
ReadString
(
"Logs"
,
"ErrLog"
);
gcpcinfo
.
moduleinfo
.
mask
=
wtd624x_mask
;
string
hmi_log
=
ini
.
ReadString
(
"Logs"
,
"HmiLog"
);
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_gw
))
{
gcpcinfo
.
moduleinfo
.
gw
=
wtd624x_gw
;
}
if
(!
String
.
IsNullOrEmpty
(
gc485
))
string
gc485
=
ini
.
ReadString
(
"GC485"
,
"COM"
);
{
gcpcinfo
.
outputinfo
.
port
=
Convert
.
ToByte
(
gc485
);
}
if
(!
String
.
IsNullOrEmpty
(
info_log
))
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
{
gcpcinfo
.
pcworkinfo
.
info_log
=
info_log
.
Equals
(
"1"
)
?
true
:
false
;
}
if
(!
String
.
IsNullOrEmpty
(
err_log
)
)
//if (Convert.ToInt32(opensys) == 1
)
{
//
{
gcpcinfo
.
pcworkinfo
.
error_log
=
err_log
.
Equals
(
"1"
)
?
true
:
false
;
// gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype)
;
}
//
}
if
(!
String
.
IsNullOrEmpty
(
hmi_log
))
if
(!
String
.
IsNullOrEmpty
(
wtd624x_ip
))
{
gcpcinfo
.
moduleinfo
.
ip
=
wtd624x_ip
;
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_mask
))
{
gcpcinfo
.
moduleinfo
.
mask
=
wtd624x_mask
;
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_gw
))
{
gcpcinfo
.
moduleinfo
.
gw
=
wtd624x_gw
;
}
if
(!
String
.
IsNullOrEmpty
(
gc485
))
{
gcpcinfo
.
outputinfo
.
port
=
Convert
.
ToByte
(
gc485
);
}
if
(!
String
.
IsNullOrEmpty
(
info_log
))
{
gcpcinfo
.
pcworkinfo
.
info_log
=
info_log
.
Equals
(
"1"
)
?
true
:
false
;
}
if
(!
String
.
IsNullOrEmpty
(
err_log
))
{
gcpcinfo
.
pcworkinfo
.
error_log
=
err_log
.
Equals
(
"1"
)
?
true
:
false
;
}
if
(!
String
.
IsNullOrEmpty
(
hmi_log
))
{
gcpcinfo
.
pcworkinfo
.
hmi_log
=
hmi_log
.
Equals
(
"1"
)
?
true
:
false
;
}
//string file = System.Windows.Forms.Application.StartupPath + "\\startup.ini";
//if (File.Exists(file))
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
}
else
{
{
gcpcinfo
.
pcworkinfo
.
hmi_log
=
hmi_log
.
Equals
(
"1"
)
?
true
:
false
;
gcpcinfo
.
pcworkinfo
.
RunType
=
0
;
gcpcinfo
.
pcworkinfo
.
sendtohw
=
false
;
gcpcinfo
.
pcfolderinfo
.
DataFolder
=
null
;
}
}
}
}
catch
(
Exception
e
)
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
{
Log
.
Error
(
e
.
Message
);
}
}
}
}
}
}
}
GcDevicePc/GcDevicePc.csproj
View file @
edc81683
...
@@ -96,8 +96,9 @@
...
@@ -96,8 +96,9 @@
<Reference
Include=
"CKVocAlgorithm"
>
<Reference
Include=
"CKVocAlgorithm"
>
<HintPath>
..\dll\CKVocAlgorithm.dll
</HintPath>
<HintPath>
..\dll\CKVocAlgorithm.dll
</HintPath>
</Reference>
</Reference>
<Reference
Include=
"CKVocAnalyzer"
>
<Reference
Include=
"CKVocAnalyzer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\dll\CKVocAnalyzer.dll
</HintPath>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
bin\x86\Debug\CKVocAnalyzer.dll
</HintPath>
</Reference>
</Reference>
<Reference
Include=
"Ini.Net, Version=1.0.5531.18665, Culture=neutral, processorArchitecture=MSIL"
>
<Reference
Include=
"Ini.Net, Version=1.0.5531.18665, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\ini.net.1.1.0\lib\net20\Ini.Net.dll
</HintPath>
<HintPath>
..\packages\ini.net.1.1.0\lib\net20\Ini.Net.dll
</HintPath>
...
...
GcDevicePc/MDIBase.cs
View file @
edc81683
...
@@ -611,7 +611,8 @@ namespace GcDevicePc
...
@@ -611,7 +611,8 @@ namespace GcDevicePc
try
try
{
{
int
opensys
=
0
;
int
opensys
=
0
;
String
tmpfile
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//String tmpfile = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
tmpfile
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
globaldata
.
starttimer
=
0x7FFFFFFF
;
globaldata
.
starttimer
=
0x7FFFFFFF
;
IniFile
IniParser
=
new
IniFile
(
tmpfile
);
IniFile
IniParser
=
new
IniFile
(
tmpfile
);
...
@@ -1762,6 +1763,7 @@ namespace GcDevicePc
...
@@ -1762,6 +1763,7 @@ namespace GcDevicePc
bool
ret
=
false
;
bool
ret
=
false
;
try
try
{
{
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
)
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
)
{
{
MessageBox
.
Show
(
"系统开启中......"
);
MessageBox
.
Show
(
"系统开启中......"
);
...
@@ -1770,42 +1772,63 @@ namespace GcDevicePc
...
@@ -1770,42 +1772,63 @@ namespace GcDevicePc
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
{
hmiopt
.
WriteStopVal
();
if
(!
OSflag
)
statestr
=
"系统准备中..."
;
{
OSflag
=
!
OSflag
;
hmiopt
.
WriteStopVal
();
statestr
=
"系统准备中..."
;
WaitHMIFree
();
WaitHMIFree
();
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
2
)
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
2
)
{
{
hmiopt
.
WriteBatVal
();
hmiopt
.
WriteBatVal
();
}
}
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
0
)
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
0
)
{
{
hmiopt
.
WriteOpenVal
();
hmiopt
.
WriteOpenVal
();
}
}
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
1
)
{
hmiopt
.
WriteSingleVal
();
}
//Console.WriteLine("WaitHMIWork ");
WaitHMIWork
();
//Console.WriteLine("WaitHMIWork End");
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
true
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
globaldata
.
starttimer
=
0
;
globaldata
.
startimerIsSet
=
true
;
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
RunType
==
1
)
{
hmiopt
.
WriteSingleVal
();
}
}
Console
.
WriteLine
(
"WaitHMIWork "
);
else
WaitHMIWork
();
{
Console
.
WriteLine
(
"WaitHMIWork End"
);
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
true
;
OSflag
=
!
OSflag
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
//SetTitleStatueName("系统停止中...", false);
globaldata
.
starttimer
=
0
;
globaldata
.
OS_STOP
=
true
;
globaldata
.
startimerIsSet
=
true
;
hmiopt
.
WriteEndVal
();
WaitHMIFree
();
//SetTitleStatueName("系统停止...", false);
//int tagnum = Convert.ToInt32(((PictureBox)panelMenu.Controls[14]).Tag);
//((PictureBox)panelMenu.Controls[14]).Image = menuList.Images[tagnum];
//((PictureBox)panelMenu.Controls[0]).Enabled = false;
//((PictureBox)panelMenu.Controls[0]).Image = menuList.Images[14];
//((PictureBox)panelMenu.Controls[1]).Enabled = false;
//((PictureBox)panelMenu.Controls[1]).Image = menuList.Images[15];
//((PictureBox)panelMenu.Controls[2]).Enabled = false;
//((PictureBox)panelMenu.Controls[2]).Image = menuList.Images[16];
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
false
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
}
}
}
else
{
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
=
false
;
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
}
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
...
@@ -1911,7 +1934,7 @@ namespace GcDevicePc
...
@@ -1911,7 +1934,7 @@ namespace GcDevicePc
{
{
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
{
OSflag
=
!
OSflag
;
statestr
=
"系统停止中..."
;
statestr
=
"系统停止中..."
;
globaldata
.
OS_STOP
=
true
;
globaldata
.
OS_STOP
=
true
;
hmiopt
.
WriteEndVal
();
hmiopt
.
WriteEndVal
();
...
...
GcDevicePc/ProThread/CKvocUpdata.cs
View file @
edc81683
...
@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread
...
@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread
{
{
if
((((
UInt32
)
listRawTem
[
rami
][
0
]
<
globaldata
.
starttimer
)))
if
((((
UInt32
)
listRawTem
[
rami
][
0
]
<
globaldata
.
starttimer
)))
{
{
Console
.
WriteLine
(
"listRawTem "
+
listRawTem
[
rami
][
0
].
ToString
()
+
"starttimer "
+
globaldata
.
starttimer
.
ToString
());
//
Console.WriteLine("listRawTem " + listRawTem[rami][0].ToString() + "starttimer " + globaldata.starttimer.ToString());
}
}
else
else
{
{
...
@@ -192,11 +192,11 @@ namespace GcDevicePc.ProThread
...
@@ -192,11 +192,11 @@ namespace GcDevicePc.ProThread
if
(((((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
-
globaldata
.
starttimer
)
/
1000.0f
/
60.0f
)
>
70000
)
if
(((((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
-
globaldata
.
starttimer
)
/
1000.0f
/
60.0f
)
>
70000
)
{
{
//time += 0.00083;
//time += 0.00083;
Console
.
WriteLine
(
"ctimer "
+
((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
.
ToString
()
+
"starttimer "
+
globaldata
.
starttimer
.
ToString
());
//
Console.WriteLine("ctimer " + ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer.ToString() + "starttimer " + globaldata.starttimer.ToString());
}
}
else
else
{
{
Console
.
WriteLine
(
"两差 "
+
((((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
-
globaldata
.
starttimer
)
/
1000.0f
/
60.0f
));
//
Console.WriteLine("两差 "+ ((((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer - globaldata.starttimer) / 1000.0f / 60.0f));
time
+=
((((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
-
globaldata
.
starttimer
)
/
1000.0f
/
60.0f
);
time
+=
((((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
-
globaldata
.
starttimer
)
/
1000.0f
/
60.0f
);
}
}
...
@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread
...
@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread
{
{
listPoint
.
Add
(
new
double
[]
{
Math
.
Round
(
time
,
4
),
Math
.
Round
(
value
,
6
)
});
listPoint
.
Add
(
new
double
[]
{
Math
.
Round
(
time
,
4
),
Math
.
Round
(
value
,
6
)
});
listRaw
.
Add
(
new
double
[]
{((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
,
Math
.
Round
(
value
,
6
)
});
listRaw
.
Add
(
new
double
[]
{((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
,
Math
.
Round
(
value
,
6
)
});
Console
.
WriteLine
(
"mathtime "
+
Math
.
Round
(
time
,
4
)
+
" time "
+
time
);
//
Console.WriteLine("mathtime "+ Math.Round(time, 4) + " time " + time);
Console
.
WriteLine
(
"time1 "
+
((
SignalBuffer
.
Channel_XY
)
globaldata
.
m_signalbuffer
.
Draw_Port
[
i
]).
ctimer
+
" i "
+
i
);
//
Console.WriteLine("time1 "+ ((SignalBuffer.Channel_XY)globaldata.m_signalbuffer.Draw_Port[i]).ctimer + " i " + i);
}
}
...
...
GcDevicePc/ProThread/HMISearch.cs
View file @
edc81683
...
@@ -178,7 +178,7 @@ namespace GcDevicePc.ProThread
...
@@ -178,7 +178,7 @@ namespace GcDevicePc.ProThread
m_DeviceInfo
.
Gateway
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
120
],
pBuf
[
121
],
pBuf
[
122
],
pBuf
[
123
]);
m_DeviceInfo
.
Gateway
=
String
.
Format
(
"{0}.{1}.{2}.{3}"
,
pBuf
[
120
],
pBuf
[
121
],
pBuf
[
122
],
pBuf
[
123
]);
string
tmpmac
=
String
.
Format
(
"{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}"
,
pBuf
[
106
],
pBuf
[
107
],
pBuf
[
108
],
pBuf
[
109
],
pBuf
[
110
],
pBuf
[
111
]);
string
tmpmac
=
String
.
Format
(
"{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}"
,
pBuf
[
106
],
pBuf
[
107
],
pBuf
[
108
],
pBuf
[
109
],
pBuf
[
110
],
pBuf
[
111
]);
if
(
FMAC
!=
null
)
if
(
!
string
.
IsNullOrEmpty
(
FMAC
)
)
{
{
if
(
FMAC
==
tmpmac
)
if
(
FMAC
==
tmpmac
)
{
{
...
...
GcDevicePc/UserConfig.cs
View file @
edc81683
...
@@ -14,6 +14,7 @@ using System.Management;
...
@@ -14,6 +14,7 @@ using System.Management;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Threading
;
using
System.Net.NetworkInformation
;
using
System.Net.NetworkInformation
;
using
System.IO
;
namespace
GcDevicePc
namespace
GcDevicePc
{
{
...
@@ -27,7 +28,9 @@ namespace GcDevicePc
...
@@ -27,7 +28,9 @@ namespace GcDevicePc
private
void
autorun_CheckedChanged
(
object
sender
,
EventArgs
e
)
private
void
autorun_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
{
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
int
count
=
0
;
int
count
=
0
;
...
@@ -74,7 +77,9 @@ namespace GcDevicePc
...
@@ -74,7 +77,9 @@ namespace GcDevicePc
private
void
appstartup_CheckedChanged
(
object
sender
,
EventArgs
e
)
private
void
appstartup_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
{
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
string
value
;
string
value
;
if
(
this
.
appstartup
.
Checked
)
if
(
this
.
appstartup
.
Checked
)
...
@@ -138,7 +143,9 @@ namespace GcDevicePc
...
@@ -138,7 +143,9 @@ namespace GcDevicePc
private
void
UserConfig_Load
(
object
sender
,
EventArgs
e
)
private
void
UserConfig_Load
(
object
sender
,
EventArgs
e
)
{
{
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
string
MAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
string
MAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
string
value
=
test
.
INIGetStringValue
(
"StartUp"
,
"自启动"
,
null
);
string
value
=
test
.
INIGetStringValue
(
"StartUp"
,
"自启动"
,
null
);
...
@@ -149,16 +156,36 @@ namespace GcDevicePc
...
@@ -149,16 +156,36 @@ namespace GcDevicePc
string
err_log
=
test
.
INIGetStringValue
(
"Logs"
,
"ErrLog"
,
null
);
string
err_log
=
test
.
INIGetStringValue
(
"Logs"
,
"ErrLog"
,
null
);
string
hmi_log
=
test
.
INIGetStringValue
(
"Logs"
,
"HmiLog"
,
null
);
string
hmi_log
=
test
.
INIGetStringValue
(
"Logs"
,
"HmiLog"
,
null
);
if
(
String
.
IsNullOrEmpty
(
MAC
))
try
{
{
this
.
label1
.
Text
=
"目前Mac(未绑定):"
;
if
(
String
.
IsNullOrEmpty
(
MAC
))
//this.label3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr;
{
this
.
label1
.
Text
=
"目前Mac(未绑定):"
;
this
.
label3
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
;
mac1
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
0
].
ToString
();
mac2
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
1
].
ToString
();
mac3
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
2
].
ToString
();
mac4
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
3
].
ToString
();
mac5
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
4
].
ToString
();
mac6
.
Text
=
((
globaldata
.
DeviceInfo
)
globaldata
.
DeviceList
[
0
]).
MacAddr
.
Split
(
':'
)[
5
].
ToString
();
}
else
{
this
.
label3
.
Text
=
MAC
;
mac1
.
Text
=
MAC
.
Split
(
':'
)[
0
].
ToString
();
mac2
.
Text
=
MAC
.
Split
(
':'
)[
1
].
ToString
();
mac3
.
Text
=
MAC
.
Split
(
':'
)[
2
].
ToString
();
mac4
.
Text
=
MAC
.
Split
(
':'
)[
3
].
ToString
();
mac5
.
Text
=
MAC
.
Split
(
':'
)[
4
].
ToString
();
mac6
.
Text
=
MAC
.
Split
(
':'
)[
5
].
ToString
();
}
}
}
else
catch
{
{
this
.
label3
.
Text
=
MAC
;
}
}
if
(
Convert
.
ToInt32
(
value
)
==
1
)
if
(
Convert
.
ToInt32
(
value
)
==
1
)
{
{
this
.
appstartup
.
Checked
=
true
;
this
.
appstartup
.
Checked
=
true
;
...
@@ -277,17 +304,36 @@ namespace GcDevicePc
...
@@ -277,17 +304,36 @@ namespace GcDevicePc
private
void
changemac_Click
(
object
sender
,
EventArgs
e
)
private
void
changemac_Click
(
object
sender
,
EventArgs
e
)
{
{
//bool ret = false;
//string newMac = string.Format(String.Format("{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}", mac1.Text, mac2.Text, mac3.Text, mac4.Text, mac5.Text, mac6.Text));
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
//INIOperation test = new INIOperation(file);
//ret = test.INIWriteValue(file, "NetWorkConfig", "MAC地址", newMac);
//if (ret)
//{
// MessageBox.Show("MAC绑定修改成功!", "提示");
//}else
//{
// MessageBox.Show("MAC绑定修改失败!", "提示");
//}
bool
ret
=
false
;
bool
ret
=
false
;
string
newMac
=
string
.
Format
(
String
.
Format
(
"{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}"
,
mac1
.
Text
,
mac2
.
Text
,
mac3
.
Text
,
mac4
.
Text
,
mac5
.
Text
,
mac6
.
Text
));
string
newMac
=
string
.
Format
(
String
.
Format
(
"{0:X2}:{1:X2}:{2:X2}:{3:X2}:{4:X2}:{5:X2}"
,
mac1
.
Text
,
mac2
.
Text
,
mac3
.
Text
,
mac4
.
Text
,
mac5
.
Text
,
mac6
.
Text
));
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
ret
=
test
.
INIWriteValue
(
file
,
"NetWorkConfig"
,
"MAC地址"
,
newMac
);
ret
=
test
.
INIWriteValue
(
file
,
"NetWorkConfig"
,
"MAC地址"
,
newMac
);
if
(
ret
)
if
(
ret
)
{
{
MessageBox
.
Show
(
"MAC绑定修改成功!"
,
"提示"
);
MessageBox
.
Show
(
"MAC绑定修改成功,请重启软件!"
,
"提示"
);
}
else
}
else
{
{
MessageBox
.
Show
(
"MAC绑定修改失败!"
,
"提示"
);
MessageBox
.
Show
(
"MAC绑定修改失败!"
,
"提示"
);
}
}
...
@@ -316,7 +362,11 @@ namespace GcDevicePc
...
@@ -316,7 +362,11 @@ namespace GcDevicePc
int
i
=
0
;
int
i
=
0
;
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
string
myMAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
string
myMAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
try
try
...
@@ -497,7 +547,10 @@ namespace GcDevicePc
...
@@ -497,7 +547,10 @@ namespace GcDevicePc
/// <param name="e"></param>
/// <param name="e"></param>
private
void
permin_CheckedChanged
(
object
sender
,
EventArgs
e
)
private
void
permin_CheckedChanged
(
object
sender
,
EventArgs
e
)
{
{
string
file
=
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcfolderinfo
.
RunFolder
+
"\\startup.ini"
;
//string file = globaldata.m_pcbuffer.gcpcinfo.pcfolderinfo.RunFolder + "\\startup.ini";
string
file
=
Path
.
Combine
(
Path
.
GetDirectoryName
(
System
.
Windows
.
Forms
.
Application
.
StartupPath
),
"GC_Config\\GC_Set\\启动参数\\startup.ini"
);
try
try
{
{
INIOperation
test
=
new
INIOperation
(
file
);
INIOperation
test
=
new
INIOperation
(
file
);
...
...
dll/CKVocAnalyzer.dll
View file @
edc81683
No preview for this file type
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