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
Expand all
Show 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
...
...
@@ -839,14 +839,6 @@ namespace GcDevicePc
string
ip
;
while
(
true
)
{
Thread
.
Sleep
(
3000
);
if
(
globaldata
.
OffLinkMode
)
{
globaldata
.
connection_ip
=
""
;
break
;
}
else
{
ret
=
mysearch
.
ThStart
();
...
...
@@ -869,6 +861,11 @@ namespace GcDevicePc
mysearch
.
ReGetHmiIp
();
Thread
.
Sleep
(
2000
);
}
if
(
globaldata
.
OffLinkMode
)
{
globaldata
.
connection_ip
=
""
;
break
;
}
}
}
...
...
GcDevicePc/CK_UI/AdjustFrom.Designer.cs
View file @
edc81683
...
...
@@ -35,7 +35,7 @@
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
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
.
Name
=
"AdjustFrom"
;
this
.
StartPosition
=
System
.
Windows
.
Forms
.
FormStartPosition
.
CenterScreen
;
...
...
GcDevicePc/CK_UI/UserCtl.Designer.cs
View file @
edc81683
...
...
@@ -34,7 +34,6 @@
this
.
label3
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
label4
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
textBox1
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
textBox3
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
=
new
System
.
Windows
.
Forms
.
GroupBox
();
this
.
textBox6
=
new
System
.
Windows
.
Forms
.
TextBox
();
...
...
@@ -44,6 +43,7 @@
this
.
textBox4
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
label1
=
new
System
.
Windows
.
Forms
.
Label
();
this
.
timer1
=
new
System
.
Windows
.
Forms
.
Timer
(
this
.
components
);
this
.
textBox2
=
new
System
.
Windows
.
Forms
.
TextBox
();
this
.
groupBox1
.
SuspendLayout
();
this
.
SuspendLayout
();
//
...
...
@@ -102,15 +102,6 @@
this
.
textBox1
.
Name
=
"textBox1"
;
this
.
textBox1
.
Size
=
new
System
.
Drawing
.
Size
(
116
,
29
);
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
//
...
...
@@ -203,6 +194,14 @@
this
.
timer1
.
Interval
=
60000
;
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
//
this
.
AutoScaleDimensions
=
new
System
.
Drawing
.
SizeF
(
6F
,
12F
);
...
...
@@ -225,7 +224,6 @@
private
System
.
Windows
.
Forms
.
Label
label3
;
private
System
.
Windows
.
Forms
.
Label
label4
;
private
System
.
Windows
.
Forms
.
TextBox
textBox1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox2
;
private
System
.
Windows
.
Forms
.
TextBox
textBox3
;
private
System
.
Windows
.
Forms
.
GroupBox
groupBox1
;
private
System
.
Windows
.
Forms
.
Timer
timer1
;
...
...
@@ -235,6 +233,6 @@
private
System
.
Windows
.
Forms
.
Label
label5
;
private
System
.
Windows
.
Forms
.
TextBox
textBox4
;
private
System
.
Windows
.
Forms
.
Label
label1
;
private
System
.
Windows
.
Forms
.
TextBox
textBox2
;
}
}
GcDevicePc/CK_UI/UserCtl.cs
View file @
edc81683
...
...
@@ -58,7 +58,8 @@ namespace GcDevicePc.CK_UI
{
Systemtype
=
CKVocAnalyzer
.
GlobalCKV
.
Systemtype
;
isppm
=
false
;
groupBox1
.
Text
=
"结果(mg/m³)"
;
switch
(
Systemtype
)
{
default
:
//非甲烷总烃
...
...
@@ -273,7 +274,7 @@ namespace GcDevicePc.CK_UI
textBox1
.
Text
=
Math
.
Round
(
listNmoc
[
listNmoc
.
Count
-
1
].
Y
,
2
).
ToString
()
+
"ppm"
;
}
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³"
;
}
...
...
@@ -302,6 +303,8 @@ namespace GcDevicePc.CK_UI
}
else
textBox2
.
BackColor
=
zcolor
;
}
if
(
CKVocAnalyzer
.
GlobalCKV
.
vocparamlist
[
i
].
Name
==
CKVocAnalyzer
.
GlobalCKV
.
IngredientList
[
2
].
name
)
...
...
@@ -323,8 +326,6 @@ namespace GcDevicePc.CK_UI
textBox3
.
BackColor
=
zcolor
;
}
}
...
...
@@ -740,37 +741,37 @@ namespace GcDevicePc.CK_UI
}
private
void
textBox1_DoubleClick
(
object
sender
,
EventArgs
e
)
{
isppm
=
!
isppm
;
if
(
isppm
)
{
groupBox1
.
Text
=
"结果(ppm)"
;
}
else
groupBox1
.
Text
=
"结果(mg/m³)"
;
try
{
switch
(
Systemtype
)
{
default
:
//非甲烷总烃
data
();
datadisp
();
UIVisible
(
false
);
break
;
case
1
:
data2
();
datadisp2
();
break
;
}
// Trace.WriteLine("绘图","sys");
}
catch
(
Exception
ex
)
{
Trace
.
Write
(
ex
);
}
}
//
private void textBox1_DoubleClick(object sender, EventArgs e)
//
{
//
isppm = !isppm;
//
if(isppm)
//
{
//
groupBox1.Text = "结果(ppm)";
//
}else
//
groupBox1.Text = "结果(mg/m³)";
//
try
//
{
//
switch (Systemtype)
//
{
//
default: //非甲烷总烃
//
data();
//
datadisp();
//
UIVisible(false);
//
break;
//
case 1:
//
data2();
//
datadisp2();
//
break;
//
}
//
// Trace.WriteLine("绘图","sys");
//
}
//
catch (Exception ex)
//
{
//
Trace.Write(ex);
//
}
//
}
}
}
GcDevicePc/Common/GCModbusSlave.cs
View file @
edc81683
...
...
@@ -90,6 +90,8 @@ namespace GcDevicePc.Common
}
static
ushort
slavereadhreg
(
ushort
address
)
{
try
{
ushort
value
=
0
;
ushort
signalddress
=
17
;
...
...
@@ -127,14 +129,12 @@ namespace GcDevicePc.Common
{
value
=
0
;
}
}
else
{
value
=
0
;
}
}
//分析仪状态
if
(
address
>=
1
&&
address
<
20
)
{
...
...
@@ -142,12 +142,12 @@ namespace GcDevicePc.Common
{
case
1
:
//进度
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
1
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
2
)
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
1
||
(
ushort
)
SharedSpace
.
Data
.
typesint
==
2
)
{
if
(
SharedSpace
.
MControl
.
dateend
!=
0
&&
SharedSpace
.
MControl
.
zhouqi
!=
0
)
{
value
=
(
ushort
)
((
globaldata
.
m_hmibuffer
.
gcinfo
.
batruncount
*
1.0f
)
/
(
ushort
)
(
SharedSpace
.
MControl
.
dateend
*
1.0f
/
value
=
(
ushort
)
((
globaldata
.
m_hmibuffer
.
gcinfo
.
batruncount
*
1.0f
)
/
(
ushort
)
(
SharedSpace
.
MControl
.
dateend
*
1.0f
/
SharedSpace
.
MControl
.
zhouqi
)
*
1000
);
}
else
...
...
@@ -166,16 +166,16 @@ namespace GcDevicePc.Common
{
if
(!
SharedSpace
.
MControl
.
SetOut
&&
!
SharedSpace
.
MControl
.
SetRun
)
{
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
3
)
value
=
5
;
else
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
4
)
else
if
((
ushort
)
SharedSpace
.
Data
.
typesint
==
4
)
value
=
6
;
else
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
else
{
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
value
=
(
ushort
)
SharedSpace
.
Data
.
typesint
;
}
}
break
;
...
...
@@ -350,6 +350,15 @@ namespace GcDevicePc.Common
}
return
value
;
}
catch
(
Exception
e
)
{
Console
.
WriteLine
(
"异常"
+
e
.
Message
);
return
0
;
}
}
//static ushort slavereadhreg(ushort address)
//{
...
...
GcDevicePc/ConfigMethod/FID.cs
View file @
edc81683
...
...
@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigMethod
this
.
methodconfig
.
GetFidByID
(
index
);
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
].
fAirFlowSet
.
ToString
();
...
...
GcDevicePc/ConfigMethod/injectionport/IPPIP.cs
View file @
edc81683
...
...
@@ -34,7 +34,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
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
();
txtPressure
.
Text
=
this
.
methodconfig
.
port
[
index
].
pipPressureActual
.
ToString
();
...
...
@@ -180,7 +180,7 @@ namespace GcDevicePc.ConfigMethod.injectionport
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
();
txtPressure
.
Text
=
this
.
methodconfig
.
auxs
[
index
].
pipPressureActual
.
ToString
();
...
...
GcDevicePc/DataState.cs
View file @
edc81683
This diff is collapsed.
Click to expand it.
GcDevicePc/DeviceConfigUI/ConfigDevice.cs
View file @
edc81683
...
...
@@ -332,6 +332,8 @@ namespace GcDevicePc.DeviceConfigUI
#
region
控件事件
private
void
HMIConfigTree_NodeMouseDoubleClick
(
object
sender
,
TreeNodeMouseClickEventArgs
e
)
{
try
{
if
(
e
.
Button
==
MouseButtons
.
Right
||
e
.
Node
.
Level
==
0
)
return
;
...
...
@@ -367,6 +369,12 @@ namespace GcDevicePc.DeviceConfigUI
}
}
catch
{
}
}
/// <summary>
///
...
...
GcDevicePc/DeviceConfigUI/Device.Designer.cs
View file @
edc81683
...
...
@@ -61,8 +61,8 @@
//
this
.
StartType
.
FormattingEnabled
=
true
;
this
.
StartType
.
Items
.
AddRange
(
new
object
[]
{
"机械阀"
,
"进样EPC"
,
"机械阀"
,
"全EPC"
});
this
.
StartType
.
Location
=
new
System
.
Drawing
.
Point
(
157
,
143
);
this
.
StartType
.
Name
=
"StartType"
;
...
...
GcDevicePc/DeviceConfigUI/Device.cs
View file @
edc81683
...
...
@@ -39,7 +39,7 @@ namespace GcDevicePc.DeviceConfigUI
{
this
.
GCNum
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCNum
;
this
.
GCName
.
Text
=
this
.
hWConfig
.
hwconfiginfo
.
GCName
;
this
.
StartType
.
SelectedIndex
=
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
;
this
.
StartType
.
SelectedIndex
=
this
.
hWConfig
.
hwconfiginfo
.
u16StartType
-
1
;
}
}
catch
...
...
@@ -57,7 +57,7 @@ namespace GcDevicePc.DeviceConfigUI
{
this
.
hWConfig
.
hwconfiginfo
.
GCNum
=
this
.
GCNum
.
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
();
}
...
...
GcDevicePc/Formdebug.cs
View file @
edc81683
...
...
@@ -36,7 +36,6 @@ namespace GcDevicePc
dataleft
.
CloseButtonVisible
=
false
;
//dataleft.Close_Threading();
//dataleft.Close();
}
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.IO
;
using
System.Linq
;
...
...
@@ -116,34 +118,64 @@ namespace GcDevicePc.GCBuffer
gcpcinfo
.
outputinfo
.
port
=
0
;
try
{
//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
))
{
INIOperation
test
=
new
INIOperation
(
file
);
string
opensys
=
test
.
INIGetStringValue
(
"StartUp"
,
"打开系统"
,
null
);
string
runtype
=
test
.
INIGetStringValue
(
"StartUp"
,
"运行类型"
,
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"
,
"历史数据"
);
gcpcinfo
.
pcworkinfo
.
hmimac
=
ini
.
ReadString
(
"NetWorkConfig"
,
"MAC地址"
);
if
(
opensys
==
1
)
{
gcpcinfo
.
pcworkinfo
.
RunType
=
(
ushort
)
runtype
;
}
else
{
gcpcinfo
.
pcworkinfo
.
RunType
=
0
;
}
if
(
senddata
==
1
)
{
gcpcinfo
.
pcworkinfo
.
sendtohw
=
true
;
}
else
{
gcpcinfo
.
pcworkinfo
.
sendtohw
=
false
;
}
string
wtd624x_ip
=
test
.
INIGetStringValue
(
"WTD624X"
,
"IP"
,
null
);
string
wtd624x_mask
=
test
.
INIGetStringValue
(
"WTD624X"
,
"MASK
"
,
null
);
string
wtd624x_gw
=
test
.
INIGetStringValue
(
"WTD624X"
,
"GW
"
,
null
);
//INIOperation test = new INIOperation(file
);
//string opensys = test.INIGetStringValue("StartUp", "打开系统
", null);
//string runtype = test.INIGetStringValue("StartUp", "运行类型
", null);
string
wtd624x_ip
=
ini
.
ReadString
(
"WTD624X"
,
"IP"
);
string
wtd624x_mask
=
ini
.
ReadString
(
"WTD624X"
,
"MASK"
);
string
wtd624x_gw
=
ini
.
ReadString
(
"WTD624X"
,
"GW"
);
string
info_log
=
test
.
INIGetStringValue
(
"Logs"
,
"InfoLog"
,
null
);
string
err_log
=
test
.
INIGetStringValue
(
"Logs"
,
"ErrLog"
,
null
);
string
hmi_log
=
test
.
INIGetStringValue
(
"Logs"
,
"HmiLog"
,
null
);
string
info_log
=
ini
.
ReadString
(
"Logs"
,
"InfoLog"
);
string
err_log
=
ini
.
ReadString
(
"Logs"
,
"ErrLog"
);
string
hmi_log
=
ini
.
ReadString
(
"Logs"
,
"HmiLog"
);
string
gc485
=
test
.
INIGetStringValue
(
"GC485"
,
"COM"
,
null
);
string
gc485
=
ini
.
ReadString
(
"GC485"
,
"COM"
);
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
if
(
Convert
.
ToInt32
(
opensys
)
==
1
)
{
gcpcinfo
.
pcworkinfo
.
RunType
=
Convert
.
ToUInt16
(
runtype
);
}
//
if (Convert.ToInt32(opensys) == 1)
//
{
//
gcpcinfo.pcworkinfo.RunType = Convert.ToUInt16(runtype);
//
}
if
(!
String
.
IsNullOrEmpty
(
wtd624x_ip
))
{
...
...
@@ -179,11 +211,25 @@ namespace GcDevicePc.GCBuffer
{
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
.
RunType
=
0
;
gcpcinfo
.
pcworkinfo
.
sendtohw
=
false
;
gcpcinfo
.
pcfolderinfo
.
DataFolder
=
null
;
}
}
catch
(
Exception
e
)
{
Log
.
Error
(
e
.
Message
);
}
}
}
}
GcDevicePc/GcDevicePc.csproj
View file @
edc81683
...
...
@@ -96,8 +96,9 @@
<Reference
Include=
"CKVocAlgorithm"
>
<HintPath>
..\dll\CKVocAlgorithm.dll
</HintPath>
</Reference>
<Reference
Include=
"CKVocAnalyzer"
>
<HintPath>
..\dll\CKVocAnalyzer.dll
</HintPath>
<Reference
Include=
"CKVocAnalyzer, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<SpecificVersion>
False
</SpecificVersion>
<HintPath>
bin\x86\Debug\CKVocAnalyzer.dll
</HintPath>
</Reference>
<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>
...
...
GcDevicePc/MDIBase.cs
View file @
edc81683
...
...
@@ -611,7 +611,8 @@ namespace GcDevicePc
try
{
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
;
IniFile
IniParser
=
new
IniFile
(
tmpfile
);
...
...
@@ -1762,6 +1763,7 @@ namespace GcDevicePc
bool
ret
=
false
;
try
{
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcworkinfo
.
system_Statue
)
{
MessageBox
.
Show
(
"系统开启中......"
);
...
...
@@ -1770,6 +1772,9 @@ namespace GcDevicePc
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
if
(!
OSflag
)
{
OSflag
=
!
OSflag
;
hmiopt
.
WriteStopVal
();
statestr
=
"系统准备中..."
;
...
...
@@ -1789,23 +1794,41 @@ namespace GcDevicePc
{
hmiopt
.
WriteSingleVal
();
}
Console
.
WriteLine
(
"WaitHMIWork "
);
//
Console.WriteLine("WaitHMIWork ");
WaitHMIWork
();
Console
.
WriteLine
(
"WaitHMIWork End"
);
//
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
;
}
else
{
OSflag
=
!
OSflag
;
//SetTitleStatueName("系统停止中...", false);
globaldata
.
OS_STOP
=
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
;
}
}
}
catch
(
Exception
ex
)
...
...
@@ -1911,7 +1934,7 @@ namespace GcDevicePc
{
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
connection_ip
))
{
OSflag
=
!
OSflag
;
statestr
=
"系统停止中..."
;
globaldata
.
OS_STOP
=
true
;
hmiopt
.
WriteEndVal
();
...
...
GcDevicePc/ProThread/CKvocUpdata.cs
View file @
edc81683
...
...
@@ -169,7 +169,7 @@ namespace GcDevicePc.ProThread
{
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
{
...
...
@@ -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
)
{
//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
{
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
);
}
...
...
@@ -209,8 +209,8 @@ namespace GcDevicePc.ProThread
{
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
)
});
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("mathtime "+ Math.Round(time, 4) + " time " + time);
//
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
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
]);
if
(
FMAC
!=
null
)
if
(
!
string
.
IsNullOrEmpty
(
FMAC
)
)
{
if
(
FMAC
==
tmpmac
)
{
...
...
GcDevicePc/UserConfig.cs
View file @
edc81683
...
...
@@ -14,6 +14,7 @@ using System.Management;
using
System.Text.RegularExpressions
;
using
System.Threading
;
using
System.Net.NetworkInformation
;
using
System.IO
;
namespace
GcDevicePc
{
...
...
@@ -27,7 +28,9 @@ namespace GcDevicePc
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
);
int
count
=
0
;
...
...
@@ -74,7 +77,9 @@ namespace GcDevicePc
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
);
string
value
;
if
(
this
.
appstartup
.
Checked
)
...
...
@@ -138,7 +143,9 @@ namespace GcDevicePc
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
);
string
MAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
string
value
=
test
.
INIGetStringValue
(
"StartUp"
,
"自启动"
,
null
);
...
...
@@ -149,15 +156,35 @@ namespace GcDevicePc
string
err_log
=
test
.
INIGetStringValue
(
"Logs"
,
"ErrLog"
,
null
);
string
hmi_log
=
test
.
INIGetStringValue
(
"Logs"
,
"HmiLog"
,
null
);
try
{
if
(
String
.
IsNullOrEmpty
(
MAC
))
{
this
.
label1
.
Text
=
"目前Mac(未绑定):"
;
//this.label3.Text = ((globaldata.DeviceInfo)globaldata.DeviceList[0]).MacAddr;
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
();
}
}
catch
{
}
if
(
Convert
.
ToInt32
(
value
)
==
1
)
{
...
...
@@ -277,17 +304,36 @@ namespace GcDevicePc
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
;
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
);
ret
=
test
.
INIWriteValue
(
file
,
"NetWorkConfig"
,
"MAC地址"
,
newMac
);
if
(
ret
)
{
MessageBox
.
Show
(
"MAC绑定修改成功!"
,
"提示"
);
}
else
MessageBox
.
Show
(
"MAC绑定修改成功,请重启软件!"
,
"提示"
);
}
else
{
MessageBox
.
Show
(
"MAC绑定修改失败!"
,
"提示"
);
}
...
...
@@ -316,7 +362,11 @@ namespace GcDevicePc
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
);
string
myMAC
=
test
.
INIGetStringValue
(
"NetWorkConfig"
,
"MAC地址"
,
null
);
try
...
...
@@ -497,7 +547,10 @@ namespace GcDevicePc
/// <param name="e"></param>
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
{
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