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
00cc97e1
Commit
00cc97e1
authored
Jun 05, 2019
by
liu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
针对程序一对二仪器,进行小改变
parent
f043db03
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
48 deletions
+64
-48
App.config
GcDevicePc/App.config
+36
-36
Program.cs
GcDevicePc/Program.cs
+25
-10
Settings.Designer.cs
GcDevicePc/Properties/Settings.Designer.cs
+1
-1
StartForm.cs
GcDevicePc/StartForm.cs
+1
-0
globaldata.cs
GcDevicePc/globaldata.cs
+1
-1
logo2.ico
GcDevicePc/logo2.ico
+0
-0
No files found.
GcDevicePc/App.config
View file @
00cc97e1
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
configuration
>
<
configSections
>
<
configSections
>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler, log4net"
/>
<
section
name
=
"log4net"
type
=
"log4net.Config.Log4NetConfigurationSectionHandler, log4net"
/>
</
configSections
>
</
configSections
>
<
startup
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.5"
/>
</
startup
>
</
startup
>
<
runtime
>
<
runtime
>
<
legacyUnhandledExceptionPolicy
enabled
=
"true"
/>
<
legacyUnhandledExceptionPolicy
enabled
=
"true"
/>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
assemblyBinding
xmlns
=
"urn:schemas-microsoft-com:asm.v1"
>
<
dependentAssembly
>
<
dependentAssembly
>
<
assemblyIdentity
name
=
"System.Data.SQLite"
publicKeyToken
=
"db937bc2d44ff139"
culture
=
"neutral"
/>
<
assemblyIdentity
name
=
"System.Data.SQLite"
publicKeyToken
=
"db937bc2d44ff139"
culture
=
"neutral"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.0.104.0"
newVersion
=
"1.0.104.0"
/>
<
bindingRedirect
oldVersion
=
"0.0.0.0-1.0.104.0"
newVersion
=
"1.0.104.0"
/>
</
dependentAssembly
>
</
dependentAssembly
>
</
assemblyBinding
>
</
assemblyBinding
>
</
runtime
>
</
runtime
>
<
log4net
>
<
log4net
>
<
logger
name
=
"Log"
>
<
logger
name
=
"Log"
>
<
level
value
=
"INFO"
/>
<
level
value
=
"INFO"
/>
<
appender
-
ref
ref
=
"RollingLog"
/>
<
appender
-
ref
ref
=
"RollingLog"
/>
</
logger
>
</
logger
>
<
logger
name
=
"Err"
>
<
logger
name
=
"Err"
>
<
level
value
=
"ERROR"
/>
<
level
value
=
"ERROR"
/>
<
appender
-
ref
ref
=
"RollingErr"
/>
<
appender
-
ref
ref
=
"RollingErr"
/>
</
logger
>
</
logger
>
<
logger
name
=
"HmiInfo"
>
<
logger
name
=
"HmiInfo"
>
<
level
value
=
"INFO"
/>
<
level
value
=
"INFO"
/>
<
appender
-
ref
ref
=
"HmiRollingLog"
/>
<
appender
-
ref
ref
=
"HmiRollingLog"
/>
</
logger
>
</
logger
>
<
appender
name
=
"RollingLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"..\GC_User\Logs\InfoLog_"
/>
<
file
value
=
"..\GC_User\Logs\InfoLog_"
/>
<
appendToFile
value
=
"true"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
staticLogFileName
value
=
"false"
/>
<
staticLogFileName
value
=
"false"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"Record Time:%d Thread ID:[%thread]- Info:%m%n"
/>
<
conversionPattern
value
=
"Record Time:%d Thread ID:[%thread]- Info:%m%n"
/>
</
layout
>
</
layout
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
param
name
=
"LevelMin"
value
=
"INFO"
/>
<
param
name
=
"LevelMin"
value
=
"INFO"
/>
<
param
name
=
"LevelMax"
value
=
"INFO"
/>
<
param
name
=
"LevelMax"
value
=
"INFO"
/>
</
filter
>
</
filter
>
</
appender
>
</
appender
>
<
appender
name
=
"HmiRollingLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"HmiRollingLog"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"..\GC_User\Logs\HmiLog_"
/>
<
file
value
=
"..\GC_User\Logs\HmiLog_"
/>
<
appendToFile
value
=
"true"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
staticLogFileName
value
=
"false"
/>
<
staticLogFileName
value
=
"false"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"Record Time:%d Info:%m%n"
/>
<
conversionPattern
value
=
"Record Time:%d Info:%m%n"
/>
</
layout
>
</
layout
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
param
name
=
"LevelMin"
value
=
"INFO"
/>
<
param
name
=
"LevelMin"
value
=
"INFO"
/>
<
param
name
=
"LevelMax"
value
=
"INFO"
/>
<
param
name
=
"LevelMax"
value
=
"INFO"
/>
</
filter
>
</
filter
>
</
appender
>
</
appender
>
<
appender
name
=
"RollingErr"
type
=
"log4net.Appender.RollingFileAppender"
>
<
appender
name
=
"RollingErr"
type
=
"log4net.Appender.RollingFileAppender"
>
<
file
value
=
"..\GC_User\Logs\ErrLog_"
/>
<
file
value
=
"..\GC_User\Logs\ErrLog_"
/>
<
appendToFile
value
=
"true"
/>
<
appendToFile
value
=
"true"
/>
<
rollingStyle
value
=
"Date"
/>
<
rollingStyle
value
=
"Date"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
datePattern
value
=
"yyyyMMdd'.txt'"
/>
<
staticLogFileName
value
=
"false"
/>
<
staticLogFileName
value
=
"false"
/>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
layout
type
=
"log4net.Layout.PatternLayout"
>
<
conversionPattern
value
=
"Record Time:%d Thread ID:[%thread]- Error:%m%n"
/>
<
conversionPattern
value
=
"Record Time:%d Thread ID:[%thread]- Error:%m%n"
/>
</
layout
>
</
layout
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
filter
type
=
"log4net.Filter.LevelRangeFilter"
>
<
param
name
=
"LevelMin"
value
=
"ERROR"
/>
<
param
name
=
"LevelMin"
value
=
"ERROR"
/>
<
param
name
=
"LevelMax"
value
=
"ERROR"
/>
<
param
name
=
"LevelMax"
value
=
"ERROR"
/>
</
filter
>
</
filter
>
</
appender
>
</
appender
>
</
log4net
>
</
log4net
>
...
...
GcDevicePc/Program.cs
View file @
00cc97e1
using
System
;
using
System
;
using
System.Linq
;
using
System.Windows.Forms
;
using
System.Windows.Forms
;
namespace
GcDevicePc
namespace
GcDevicePc
...
@@ -14,22 +15,36 @@ namespace GcDevicePc
...
@@ -14,22 +15,36 @@ namespace GcDevicePc
bool
createNew
;
bool
createNew
;
//Application.Run(new TestForm());
//Application.Run(new TestForm());
{
{
using
(
System
.
Threading
.
Mutex
mutex
=
new
System
.
Threading
.
Mutex
(
true
,
Application
.
ProductName
,
out
createNew
))
int
num
=
System
.
Diagnostics
.
Process
.
GetProcessesByName
(
Application
.
ProductName
).
ToList
().
Count
;
{
if
(
num
>
2
)
if
(
createNew
)
{
Application
.
Run
(
new
StartForm
());
mutex
.
ReleaseMutex
();
}
else
{
{
MessageBox
.
Show
(
"应用程序已经在运行中
..."
);
MessageBox
.
Show
(
"应用程序已多开
..."
);
System
.
Threading
.
Thread
.
Sleep
(
1000
);
System
.
Threading
.
Thread
.
Sleep
(
1000
);
Application
.
Exit
();
Application
.
Exit
();
System
.
Diagnostics
.
Process
.
GetCurrentProcess
().
Kill
();
System
.
Diagnostics
.
Process
.
GetCurrentProcess
().
Kill
();
// System.Environment.Exit(1);
// System.Environment.Exit(1);
}
}
else
{
//存在
using
(
System
.
Threading
.
Mutex
mutex
=
new
System
.
Threading
.
Mutex
(
true
,
Application
.
ProductName
,
out
createNew
))
{
//if (createNew)
//{
Application
.
Run
(
new
StartForm
());
mutex
.
ReleaseMutex
();
//}
//else
//{
// MessageBox.Show("应用程序已经在运行中...");
// System.Threading.Thread.Sleep(1000);
// Application.Exit();
// System.Diagnostics.Process.GetCurrentProcess().Kill();
// // System.Environment.Exit(1);
//}
}
}
}
}
}
}
}
}
}
...
...
GcDevicePc/Properties/Settings.Designer.cs
View file @
00cc97e1
...
@@ -12,7 +12,7 @@ namespace GcDevicePc.Properties {
...
@@ -12,7 +12,7 @@ namespace GcDevicePc.Properties {
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
Runtime
.
CompilerServices
.
CompilerGeneratedAttribute
()]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"1
2.0
.0.0"
)]
[
global
::
System
.
CodeDom
.
Compiler
.
GeneratedCodeAttribute
(
"Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator"
,
"1
6.1
.0.0"
)]
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
internal
sealed
partial
class
Settings
:
global
::
System
.
Configuration
.
ApplicationSettingsBase
{
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
private
static
Settings
defaultInstance
=
((
Settings
)(
global
::
System
.
Configuration
.
ApplicationSettingsBase
.
Synchronized
(
new
Settings
())));
...
...
GcDevicePc/StartForm.cs
View file @
00cc97e1
...
@@ -109,6 +109,7 @@ namespace GcDevicePc
...
@@ -109,6 +109,7 @@ namespace GcDevicePc
_opacityTimer
.
Interval
=
30
;
_opacityTimer
.
Interval
=
30
;
_opacityTimer
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
OpacityTimerProcOpen
);
_opacityTimer
.
Elapsed
+=
new
System
.
Timers
.
ElapsedEventHandler
(
OpacityTimerProcOpen
);
_opacityTimer
.
Start
();
_opacityTimer
.
Start
();
//globaldata.ProgramCount = num;
}
}
private
void
MainFrmStartProc
()
private
void
MainFrmStartProc
()
...
...
GcDevicePc/globaldata.cs
View file @
00cc97e1
...
@@ -95,7 +95,7 @@ namespace GcDevicePc
...
@@ -95,7 +95,7 @@ namespace GcDevicePc
public
static
PCBuffer
m_pcbuffer
=
new
PCBuffer
();
public
static
PCBuffer
m_pcbuffer
=
new
PCBuffer
();
public
static
SignalBuffer
m_signalbuffer
=
new
SignalBuffer
();
public
static
SignalBuffer
m_signalbuffer
=
new
SignalBuffer
();
//public static int ProgramCount = 0;
//
//
public
static
HWConfig
m_hwconfig
=
new
HWConfig
();
public
static
HWConfig
m_hwconfig
=
new
HWConfig
();
...
...
GcDevicePc/logo2.ico
0 → 100644
View file @
00cc97e1
9.44 KB
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