Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
PastureGateway
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
steven.sha
PastureGateway
Commits
ee7b5c46
Commit
ee7b5c46
authored
May 20, 2019
by
shaxuezheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加控制部分
parent
819bd750
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
226 additions
and
105 deletions
+226
-105
Totxt.cs
ModbusDemo/Common/Totxt.cs
+20
-9
mqttpacke.cs
ModbusDemo/MessageFormat/mqttpacke.cs
+36
-3
TransferPool.cs
ModbusDemo/application/TransferPool.cs
+1
-0
Form1.cs
ModbusDemo/windows/Form1.cs
+169
-93
No files found.
ModbusDemo/Common/Totxt.cs
View file @
ee7b5c46
...
...
@@ -37,20 +37,31 @@ namespace ModbusDemo.windows
writer
=
new
StreamWriter
(
fileStream
);
}
writer
.
WriteLine
(
DateTime
.
Now
+
": "
+
info
);
}
finally
catch
(
Exception
e
)
{
if
(
writer
!=
null
)
{
if
(
writer
!=
null
)
{
writer
.
Close
();
writer
.
Dispose
();
fileStream
.
Close
();
fileStream
.
Dispose
();
}
writer
.
Close
();
writer
.
Dispose
();
fileStream
.
Close
();
fileStream
.
Dispose
();
}
throw
;
}
finally
{
if
(
writer
!=
null
)
{
writer
.
Close
();
writer
.
Dispose
();
fileStream
.
Close
();
fileStream
.
Dispose
();
}
}
}
public
void
CreateDirectory
(
string
infoPath
)
{
DirectoryInfo
directoryInfo
=
Directory
.
GetParent
(
infoPath
);
...
...
ModbusDemo/MessageFormat/mqttpacke.cs
View file @
ee7b5c46
...
...
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Collections
;
namespace
ModbusDemo
{
class
startAddress
...
...
@@ -95,10 +95,44 @@ namespace ModbusDemo
}
public
List
<
Ss
>
ss
{
get
;
set
;
}
}
public
class
Ctrl2
{
public
string
taskId
;
public
void
settaskId
(
string
taskId
)
{
this
.
taskId
=
taskId
;
}
public
string
gettaskId
()
{
return
taskId
;
}
public
List
<
Sss
>
ss
{
get
;
set
;}
}
public
class
Sss
{
public
byte
addr
;
private
Hashtable
dn
=
new
Hashtable
();
public
Hashtable
op
{
get
=>
dn
;
set
=>
dn
=
value
;
}
public
void
setAddr
(
byte
addr
)
{
this
.
addr
=
addr
;
}
public
byte
getAddr
()
{
return
addr
;
}
}
public
class
Op
{
public
int
duration
;
public
long
startTime
;
public
int
d0
{
get
=>
D0
;
...
...
@@ -168,6 +202,7 @@ namespace ModbusDemo
{
public
byte
addr
;
public
Op
op
;
public
void
setAddr
(
byte
addr
)
{
this
.
addr
=
addr
;
...
...
@@ -176,7 +211,6 @@ namespace ModbusDemo
{
return
addr
;
}
public
void
setOp
(
Op
op
)
{
this
.
op
=
op
;
...
...
@@ -185,6 +219,5 @@ namespace ModbusDemo
{
return
op
;
}
}
}
ModbusDemo/application/TransferPool.cs
View file @
ee7b5c46
...
...
@@ -4,6 +4,7 @@ using System.Linq;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Timers
;
namespace
ModbusDemo.windows
{
class
TransferPool
...
...
ModbusDemo/windows/Form1.cs
View file @
ee7b5c46
This diff is collapsed.
Click to expand it.
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