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
d1f6922e
Commit
d1f6922e
authored
Jun 07, 2018
by
wangwanxh@sina.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'wang_master' of
https://gitee.com/wangwanxh/Vocs
into wang_master
parents
75111627
5a2fce42
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
103 additions
and
62 deletions
+103
-62
AppInit.cs
GcDevicePc/AppInit.cs
+1
-13
CurveDisPlay.cs
GcDevicePc/CK_UI/CurveDisPlay.cs
+1
-0
LandIn.cs
GcDevicePc/CK_UI/LandIn.cs
+16
-3
MethodBase.Designer.cs
GcDevicePc/ConfigDlg/MethodBase.Designer.cs
+1
-1
PCBuffer.cs
GcDevicePc/GCBuffer/PCBuffer.cs
+18
-1
MDIBase.cs
GcDevicePc/MDIBase.cs
+40
-20
MainBase.cs
GcDevicePc/MainBase.cs
+0
-7
CKvocUpdata.cs
GcDevicePc/ProThread/CKvocUpdata.cs
+0
-4
DataOutput.cs
GcDevicePc/ProThread/DataOutput.cs
+25
-12
HMISearch.cs
GcDevicePc/ProThread/HMISearch.cs
+1
-1
No files found.
GcDevicePc/AppInit.cs
View file @
d1f6922e
...
...
@@ -123,13 +123,6 @@ namespace GcDevicePc
{
ret
=
mainclient
.
WtClientCopyfromServer
(
filename
[
i
],
getfile
,
foldername
[
i
]);
Thread
.
Sleep
(
500
);
//checkflag = filecheck.IsUse(getfile);
//while (checkflag != 0)
//{
// Thread.Sleep(200);
// checkflag = filecheck.IsUse(getfile);
//}
if
(
ret
==
0
)
{
Log
.
Info
(
filename
[
i
].
ToString
()
+
" 同步成功"
);
...
...
@@ -195,7 +188,7 @@ namespace GcDevicePc
NetworkInterface
[]
nics
=
NetworkInterface
.
GetAllNetworkInterfaces
();
foreach
(
NetworkInterface
adapter
in
nics
)
{
//
if (adapter.Name == "本地连接")
if
(
adapter
.
Name
==
"本地连接"
)
{
bool
pd1
=
(
adapter
.
NetworkInterfaceType
==
NetworkInterfaceType
.
Ethernet
||
adapter
.
NetworkInterfaceType
==
NetworkInterfaceType
.
Wireless80211
);
...
...
@@ -271,10 +264,5 @@ namespace GcDevicePc
}
}
public
void
InitDB
()
{
}
}
}
GcDevicePc/CK_UI/CurveDisPlay.cs
View file @
d1f6922e
...
...
@@ -27,6 +27,7 @@ namespace GcDevicePc
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Left
)
|
System
.
Windows
.
Forms
.
AnchorStyles
.
Right
)));
this
.
Controls
.
Add
(
curdisp
);
CheckForIllegalCrossThreadCalls
=
false
;
}
}
}
GcDevicePc/CK_UI/LandIn.cs
View file @
d1f6922e
...
...
@@ -31,15 +31,28 @@ namespace GcDevicePc.CK_UI
{
Island
=
false
;
}
if
(
form
!=
null
)
if
(
form
!=
null
)
{
form
.
Dispose
();
form
.
Close
();
if
(!
form
.
IsDisposed
)
{
form
.
Dispose
();
}
}
}
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
//放弃
{
Island
=
false
;
if
(
form
!=
null
)
{
form
.
Close
();
if
(!
form
.
IsDisposed
)
{
form
.
Dispose
();
}
}
}
private
void
LandIn_Load
(
object
sender
,
EventArgs
e
)
...
...
@@ -50,7 +63,7 @@ namespace GcDevicePc.CK_UI
private
void
textBox2_Click
(
object
sender
,
EventArgs
e
)
{
form
=
CKVocAnalyzer
.
NumForm
.
GetInstance
((
TextBox
)
sender
);
// new CKVocAnalyzer.NumForm((TextBox)sender);
form
.
Icon
=
this
.
Icon
;
form
.
Show
();
}
}
...
...
GcDevicePc/ConfigDlg/MethodBase.Designer.cs
View file @
d1f6922e
...
...
@@ -31,7 +31,7 @@ namespace GcDevicePc.ConfigDlg
{
this
.
components
=
new
System
.
ComponentModel
.
Container
();
System
.
ComponentModel
.
ComponentResourceManager
resources
=
new
System
.
ComponentModel
.
ComponentResourceManager
(
typeof
(
MethodBase
));
this
.
methodimgList
=
new
System
.
Windows
.
Forms
.
ImageList
(
this
.
components
);
this
.
methodimgList
=
new
System
.
Windows
.
Forms
.
ImageList
();
this
.
Methodtitle
=
new
System
.
Windows
.
Forms
.
Panel
();
this
.
mmixbtn
=
new
System
.
Windows
.
Forms
.
Button
();
this
.
mclose
=
new
System
.
Windows
.
Forms
.
Button
();
...
...
GcDevicePc/GCBuffer/PCBuffer.cs
View file @
d1f6922e
...
...
@@ -47,7 +47,12 @@ namespace GcDevicePc.GCBuffer
public
string
ip
;
public
string
mask
;
public
string
gw
;
}
public
struct
OutPutInfo
{
public
byte
port
;
}
public
struct
ThreadInfo
...
...
@@ -62,6 +67,8 @@ namespace GcDevicePc.GCBuffer
public
WorkInfo
pcworkinfo
;
public
ModuleInfo
moduleinfo
;
public
ThreadInfo
pcthreadinfo
;
public
OutPutInfo
outputinfo
;
}
public
PCInfo
gcpcinfo
=
new
PCInfo
();
...
...
@@ -91,7 +98,9 @@ namespace GcDevicePc.GCBuffer
gcpcinfo
.
pcworkinfo
.
system_Statue
=
false
;
gcpcinfo
.
pcworkinfo
.
work_Statue
=
0
;
gcpcinfo
.
moduleinfo
.
ip
=
"192.168.1.54"
;
gcpcinfo
.
moduleinfo
.
ip
=
""
;
gcpcinfo
.
outputinfo
.
port
=
0
;
string
file
=
System
.
Windows
.
Forms
.
Application
.
StartupPath
+
"\\startup.ini"
;
...
...
@@ -106,6 +115,9 @@ namespace GcDevicePc.GCBuffer
string
wtd624x_mask
=
test
.
INIGetStringValue
(
"WTD624X"
,
"MASK"
,
null
);
string
wtd624x_gw
=
test
.
INIGetStringValue
(
"WTD624X"
,
"GW"
,
null
);
string
gc485
=
test
.
INIGetStringValue
(
"GC485"
,
"COM"
,
null
);
//string senddata = test.INIGetStringValue("StartUp", "SendData", null);
if
(
Convert
.
ToInt32
(
opensys
)
==
1
)
...
...
@@ -127,6 +139,11 @@ namespace GcDevicePc.GCBuffer
{
gcpcinfo
.
moduleinfo
.
gw
=
wtd624x_gw
;
}
if
(!
String
.
IsNullOrEmpty
(
gc485
))
{
gcpcinfo
.
outputinfo
.
port
=
Convert
.
ToByte
(
gc485
);
}
}
// gcpcinfo.pcworkinfo.RunType = 0; //运行类型 0 打开运行 1 智能运行 2 批处理
...
...
GcDevicePc/MDIBase.cs
View file @
d1f6922e
...
...
@@ -58,6 +58,8 @@ namespace GcDevicePc
/// </summary>
CKvocUpdata
dataVOC
=
new
CKvocUpdata
();
private
DataOutput
wtd624xOutput
=
new
DataOutput
();
#
region
Author
by
zjx
/// <summary>
/// 组件初始化
...
...
@@ -367,7 +369,7 @@ namespace GcDevicePc
if
(
i
!=
99
)
{
worker
.
ReportProgress
(
i
);
break
;
//
break;
}
}
...
...
@@ -398,7 +400,7 @@ namespace GcDevicePc
public
void
WaitHMIFree
()
{
if
(
globaldata
.
m_hmibuffer
.
gcinfo
.
hmistatus
!=
0
)
//
if (globaldata.m_hmibuffer.gcinfo.hmistatus != 0)
{
this
.
backgroundWorker1
.
RunWorkerAsync
();
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker1
,
"Free"
);
...
...
@@ -463,7 +465,7 @@ namespace GcDevicePc
}
public
void
WaitHMIWork
()
{
if
(
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
<
0
||
globaldata
.
m_hmibuffer
.
gcinfo
.
methodstatus
>
5
)
//
if (globaldata.m_hmibuffer.gcinfo.methodstatus < 0 || globaldata.m_hmibuffer.gcinfo.methodstatus > 5)
{
this
.
backgroundWorker2
.
RunWorkerAsync
();
WaitForm
form
=
new
WaitForm
(
this
.
backgroundWorker2
,
"Work"
);
...
...
@@ -548,8 +550,12 @@ namespace GcDevicePc
Slavetest
=
new
GCModbusSlave
();
Slavetest
.
CModbusSlaveInit
(
1
,
2
,
3
,
5
);
Slave485test
=
new
GCModbusSlave485
(
1
,
9600
);
Slave485test
.
CModbusSlave485Init
(
1
,
2
,
3
,
5
);
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
outputinfo
.
port
!=
0
)
{
Slave485test
=
new
GCModbusSlave485
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
outputinfo
.
port
,
9600
);
Slave485test
.
CModbusSlave485Init
(
1
,
2
,
3
,
5
);
}
}
catch
(
Exception
e
)
...
...
@@ -582,6 +588,9 @@ namespace GcDevicePc
dataVOC
.
CKvocUpdataStart
();
mytcptest
.
DataRcvStart
();
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
moduleinfo
.
ip
))
wtd624xOutput
.
DataOutStart
();
}
private
void
Stop_Thread
()
...
...
@@ -596,6 +605,9 @@ namespace GcDevicePc
mymodbus
.
HmiStatueStop
();
mymodbus
.
ChannelDataStop
();
}
if
(!
String
.
IsNullOrEmpty
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
moduleinfo
.
ip
))
wtd624xOutput
.
DataOutStop
();
}
/// <summary>
...
...
@@ -992,7 +1004,7 @@ namespace GcDevicePc
conmre
.
Set
();
globaldata
.
m_pcbuffer
.
gcpcinfo
.
pcthreadinfo
.
HMI_Monitor_TH
=
1
;
Thread
.
Sleep
(
1
5
00
);
Thread
.
Sleep
(
1
0
00
);
count
=
0
;
...
...
@@ -1008,18 +1020,22 @@ namespace GcDevicePc
}
}
count
=
0
;
ret
=
Slave485test
.
CModbusSlave485Close
();
while
(
ret
!=
0
)
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
outputinfo
.
port
!=
0
)
{
count
++
;
count
=
0
;
ret
=
Slave485test
.
CModbusSlave485Close
();
Thread
.
Sleep
(
100
);
if
(
count
>
3
)
while
(
ret
!=
0
)
{
break
;
count
++;
ret
=
Slave485test
.
CModbusSlave485Close
();
Thread
.
Sleep
(
100
);
if
(
count
>
3
)
{
break
;
}
}
}
}
...
...
@@ -1076,18 +1092,22 @@ namespace GcDevicePc
}
}
count
=
0
;
ret
=
Slave485test
.
CModbusSlave485Close
();
while
(
ret
!=
0
)
if
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
outputinfo
.
port
!=
0
)
{
count
++
;
count
=
0
;
ret
=
Slave485test
.
CModbusSlave485Close
();
Thread
.
Sleep
(
100
);
if
(
count
>
3
)
while
(
ret
!=
0
)
{
break
;
count
++;
ret
=
Slave485test
.
CModbusSlave485Close
();
Thread
.
Sleep
(
100
);
if
(
count
>
3
)
{
break
;
}
}
}
}
...
...
GcDevicePc/MainBase.cs
View file @
d1f6922e
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
using
System.Windows.Forms
;
using
WeifenLuo.WinFormsUI.Docking
;
using
GcDevicePc.IniParam
;
using
System.IO
;
using
System.Runtime.InteropServices
;
using
GcDevicePc.ProThread
;
using
System.Security.Cryptography
;
using
System.Diagnostics
;
using
GcDevicePc.Common
;
...
...
GcDevicePc/ProThread/CKvocUpdata.cs
View file @
d1f6922e
...
...
@@ -100,7 +100,6 @@ namespace GcDevicePc.ProThread
globaldata
.
starttimer
=
globaldata
.
m_hmibuffer
.
gcinfo
.
NowStartTime
;
NowTimeOld
=
globaldata
.
m_hmibuffer
.
gcinfo
.
NowStartTime
;
CurveDisPlay
.
curdisp
.
cleardata
();
}
else
...
...
@@ -191,9 +190,6 @@ 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
)
});
}
...
...
GcDevicePc/ProThread/DataOutput.cs
View file @
d1f6922e
...
...
@@ -15,7 +15,7 @@ namespace GcDevicePc.ProThread
ManualResetEvent
outputmre
=
new
ManualResetEvent
(
false
);
Thread
t_DataOut
;
private
WTD624X
wtd624x
=
new
WTD624X
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
moduleinfo
.
ip
,
502
)
;
private
WTD624X
wtd624x
;
private
bool
c6h6
=
false
;
private
bool
c7h8
=
false
;
...
...
@@ -157,28 +157,41 @@ namespace GcDevicePc.ProThread
public
void
DataOutStart
()
{
if
(
outputmre
!=
null
)
if
(
!
String
.
IsNullOrEmpty
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
moduleinfo
.
ip
)
)
{
outputmre
.
Reset
(
);
wtd624x
=
new
WTD624X
(
globaldata
.
m_pcbuffer
.
gcpcinfo
.
moduleinfo
.
ip
,
502
);
}
t_DataOut
=
new
Thread
(
OutPut_DataList
);
t_DataOut
.
IsBackground
=
true
;
t_DataOut
.
Start
();
if
(!
wtd624x
.
GetWorkFlag
())
if
(
wtd624x
!=
null
)
{
wtd624x
.
WTD624X_Open
();
if
(
outputmre
!=
null
)
{
outputmre
.
Reset
();
}
t_DataOut
=
new
Thread
(
OutPut_DataList
);
t_DataOut
.
IsBackground
=
true
;
t_DataOut
.
Start
();
if
(!
wtd624x
.
GetWorkFlag
())
{
wtd624x
.
WTD624X_Open
();
}
}
}
public
void
DataOutStop
()
{
outputmre
.
Set
();
if
(
wtd624x
.
GetWorkFlag
())
if
(
wtd624x
!=
null
)
{
wtd624x
.
WTD624X_Open
();
outputmre
.
Set
();
if
(
wtd624x
.
GetWorkFlag
())
{
wtd624x
.
WTD624X_Open
();
}
}
}
}
...
...
GcDevicePc/ProThread/HMISearch.cs
View file @
d1f6922e
...
...
@@ -46,7 +46,7 @@ namespace GcDevicePc.ProThread
NetworkInterface
[]
nics
=
NetworkInterface
.
GetAllNetworkInterfaces
();
foreach
(
NetworkInterface
adapter
in
nics
)
{
//
if (adapter.Name == "本地连接")
if
(
adapter
.
Name
==
"本地连接"
)
{
bool
pd1
=
(
adapter
.
NetworkInterfaceType
==
NetworkInterfaceType
.
Ethernet
||
adapter
.
NetworkInterfaceType
==
NetworkInterfaceType
.
Wireless80211
);
//判断是否是以太网连接
if
(
pd1
)
...
...
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