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
819bd750
Commit
819bd750
authored
May 16, 2019
by
shaxuezheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改控制定时处理
parent
b5267af2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1055 additions
and
1591 deletions
+1055
-1591
Totxt.cs
ModbusDemo/Common/Totxt.cs
+0
-0
ConvertJson.cs
ModbusDemo/ConvertJson.cs
+0
-322
RData.cs
ModbusDemo/MessageFormat/RData.cs
+0
-0
UData.cs
ModbusDemo/MessageFormat/UData.cs
+0
-0
mqttpacke.cs
ModbusDemo/MessageFormat/mqttpacke.cs
+190
-0
ModbusDemo.csproj
ModbusDemo/ModbusDemo.csproj
+11
-19
414P.cs
ModbusDemo/Modular/414P.cs
+0
-0
418X.cs
ModbusDemo/Modular/418X.cs
+66
-73
478C.cs
ModbusDemo/Modular/478C.cs
+0
-0
Program.cs
ModbusDemo/Program.cs
+3
-7
Pond.cs
ModbusDemo/application/Pond.cs
+56
-0
TransferPool.cs
ModbusDemo/application/TransferPool.cs
+53
-0
Form1.cs
ModbusDemo/windows/Form1.cs
+676
-669
frmInputValue.Designer.cs
ModbusDemo/windows/frmInputValue.Designer.cs
+0
-300
frmInputValue.cs
ModbusDemo/windows/frmInputValue.cs
+0
-81
frmInputValue.resx
ModbusDemo/windows/frmInputValue.resx
+0
-120
No files found.
ModbusDemo/Totxt.cs
→
ModbusDemo/
Common/
Totxt.cs
View file @
819bd750
File moved
ModbusDemo/ConvertJson.cs
deleted
100644 → 0
View file @
b5267af2
This diff is collapsed.
Click to expand it.
ModbusDemo/RData.cs
→
ModbusDemo/
MessageFormat/
RData.cs
View file @
819bd750
File moved
ModbusDemo/UData.cs
→
ModbusDemo/
MessageFormat/
UData.cs
View file @
819bd750
File moved
ModbusDemo/mqttpacke.cs
→
ModbusDemo/
MessageFormat/
mqttpacke.cs
View file @
819bd750
...
@@ -6,8 +6,14 @@ using System.Threading.Tasks;
...
@@ -6,8 +6,14 @@ using System.Threading.Tasks;
namespace
ModbusDemo
namespace
ModbusDemo
{
{
class
startAddress
class
WTDR18X
{
private
ushort
address
;
private
ushort
num
;
public
ushort
Address
{
get
=>
address
;
set
=>
address
=
value
;
}
public
ushort
Num
{
get
=>
num
;
set
=>
num
=
value
;
}
}
class
WTDR18X
{
{
public
string
addr
{
get
;
set
;
}
public
string
addr
{
get
;
set
;
}
public
double
d0
{
get
;
set
;
}
public
double
d0
{
get
;
set
;
}
...
@@ -33,7 +39,7 @@ namespace ModbusDemo
...
@@ -33,7 +39,7 @@ namespace ModbusDemo
this
.
ts
=
ts
;
this
.
ts
=
ts
;
}
}
}
}
class
WTDR14P
class
WTDR14P
{
{
public
string
addr
{
get
;
set
;
}
public
string
addr
{
get
;
set
;
}
public
double
d0
{
get
;
set
;
}
public
double
d0
{
get
;
set
;
}
...
@@ -51,7 +57,7 @@ namespace ModbusDemo
...
@@ -51,7 +57,7 @@ namespace ModbusDemo
this
.
ts
=
ts
;
this
.
ts
=
ts
;
}
}
}
}
class
WTDR66C
class
WTDR66C
{
{
public
string
addr
{
get
;
set
;
}
public
string
addr
{
get
;
set
;
}
public
int
d0
{
get
;
set
;
}
public
int
d0
{
get
;
set
;
}
...
@@ -75,4 +81,110 @@ namespace ModbusDemo
...
@@ -75,4 +81,110 @@ namespace ModbusDemo
}
}
}
}
public
class
Ctrl
{
public
string
taskId
;
public
void
settaskId
(
string
taskId
)
{
this
.
taskId
=
taskId
;
}
public
string
gettaskId
()
{
return
taskId
;
}
public
List
<
Ss
>
ss
{
get
;
set
;
}
}
public
class
Op
{
public
int
duration
;
public
long
startTime
;
public
int
d0
{
get
=>
D0
;
set
=>
D0
=
value
;
}
public
int
d1
{
get
=>
D1
;
set
=>
D1
=
value
;
}
public
int
d2
{
get
=>
D2
;
set
=>
D2
=
value
;
}
public
int
d3
{
get
=>
D3
;
set
=>
D3
=
value
;
}
public
int
d4
{
get
=>
D4
;
set
=>
D4
=
value
;
}
public
int
d5
{
get
=>
D5
;
set
=>
D5
=
value
;
}
public
long
ts
{
get
=>
Ts
;
set
=>
Ts
=
value
;
}
private
int
D0
;
private
int
D1
;
private
int
D2
;
private
int
D3
;
private
int
D4
;
private
int
D5
;
private
long
Ts
;
public
void
setDuration
(
int
duration
)
{
this
.
duration
=
duration
;
}
public
int
getDuration
()
{
return
duration
;
}
public
void
setStartTime
(
long
startTime
)
{
this
.
startTime
=
startTime
;
}
public
long
getStartTime
()
{
return
startTime
;
}
}
public
class
Ss
{
public
byte
addr
;
public
Op
op
;
public
void
setAddr
(
byte
addr
)
{
this
.
addr
=
addr
;
}
public
byte
getAddr
()
{
return
addr
;
}
public
void
setOp
(
Op
op
)
{
this
.
op
=
op
;
}
public
Op
getOp
()
{
return
op
;
}
}
}
}
ModbusDemo/ModbusDemo.csproj
View file @
819bd750
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
<AssemblyName>
WTG93UG
</AssemblyName>
<AssemblyName>
WTG93UG
</AssemblyName>
<TargetFrameworkVersion>
v4.5.2
</TargetFrameworkVersion>
<TargetFrameworkVersion>
v4.5.2
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<FileAlignment>
512
</FileAlignment>
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<TargetFrameworkProfile
/>
<PublishUrl>
publish\
</PublishUrl>
<PublishUrl>
publish\
</PublishUrl>
<Install>
true
</Install>
<Install>
true
</Install>
<InstallFrom>
Disk
</InstallFrom>
<InstallFrom>
Disk
</InstallFrom>
...
@@ -23,10 +25,8 @@
...
@@ -23,10 +25,8 @@
<MapFileExtensions>
true
</MapFileExtensions>
<MapFileExtensions>
true
</MapFileExtensions>
<ApplicationRevision>
0
</ApplicationRevision>
<ApplicationRevision>
0
</ApplicationRevision>
<ApplicationVersion>
1.0.0.%2a
</ApplicationVersion>
<ApplicationVersion>
1.0.0.%2a
</ApplicationVersion>
<IsWebBootstrapper>
false
</IsWebBootstrapper>
<UseApplicationTrust>
false
</UseApplicationTrust>
<UseApplicationTrust>
false
</UseApplicationTrust>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
<BootstrapperEnabled>
true
</BootstrapperEnabled>
<TargetFrameworkProfile
/>
</PropertyGroup>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PlatformTarget>
x86
</PlatformTarget>
<PlatformTarget>
x86
</PlatformTarget>
...
@@ -81,37 +81,29 @@
...
@@ -81,37 +81,29 @@
<Reference
Include=
"System.Xml"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"414P.cs"
/>
<Compile
Include=
"application\Pond.cs"
/>
<Compile
Include=
"478C.cs"
/>
<Compile
Include=
"Modular\414P.cs"
/>
<Compile
Include=
"418X.cs"
/>
<Compile
Include=
"Modular\478C.cs"
/>
<Compile
Include=
"Modular\418X.cs"
/>
<Compile
Include=
"Common\Modbuslib.cs"
/>
<Compile
Include=
"Common\Modbuslib.cs"
/>
<Compile
Include=
"ConvertJson.cs"
/>
<Compile
Include=
"windows\Form1.cs"
>
<Compile
Include=
"windows\Form1.cs"
>
<SubType>
Form
</SubType>
<SubType>
Form
</SubType>
</Compile>
</Compile>
<Compile
Include=
"windows\Form1.Designer.cs"
>
<Compile
Include=
"windows\Form1.Designer.cs"
>
<DependentUpon>
Form1.cs
</DependentUpon>
<DependentUpon>
Form1.cs
</DependentUpon>
</Compile>
</Compile>
<Compile
Include=
"mqttpacke.cs"
/>
<Compile
Include=
"
MessageFormat\
mqttpacke.cs"
/>
<Compile
Include=
"RData.cs"
/>
<Compile
Include=
"
MessageFormat\
RData.cs"
/>
<Compile
Include=
"UData.cs"
/>
<Compile
Include=
"
MessageFormat\
UData.cs"
/>
<Compile
Include=
"Common\ModSearch.cs"
/>
<Compile
Include=
"Common\ModSearch.cs"
/>
<Compile
Include=
"Common\WTModbus.cs"
/>
<Compile
Include=
"Common\WTModbus.cs"
/>
<Compile
Include=
"windows\frmInputValue.cs"
>
<SubType>
Form
</SubType>
</Compile>
<Compile
Include=
"windows\frmInputValue.designer.cs"
>
<DependentUpon>
frmInputValue.cs
</DependentUpon>
</Compile>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
<Compile
Include=
"Totxt.cs"
/>
<Compile
Include=
"Common\Totxt.cs"
/>
<Compile
Include=
"application\TransferPool.cs"
/>
<EmbeddedResource
Include=
"windows\Form1.resx"
>
<EmbeddedResource
Include=
"windows\Form1.resx"
>
<DependentUpon>
Form1.cs
</DependentUpon>
<DependentUpon>
Form1.cs
</DependentUpon>
</EmbeddedResource>
</EmbeddedResource>
<EmbeddedResource
Include=
"windows\frmInputValue.resx"
>
<DependentUpon>
frmInputValue.cs
</DependentUpon>
</EmbeddedResource>
<EmbeddedResource
Include=
"Properties\Resources.resx"
>
<EmbeddedResource
Include=
"Properties\Resources.resx"
>
<Generator>
ResXFileCodeGenerator
</Generator>
<Generator>
ResXFileCodeGenerator
</Generator>
<LastGenOutput>
Resources.Designer.cs
</LastGenOutput>
<LastGenOutput>
Resources.Designer.cs
</LastGenOutput>
...
...
ModbusDemo/414P.cs
→
ModbusDemo/
Modular/
414P.cs
View file @
819bd750
File moved
ModbusDemo/418X.cs
→
ModbusDemo/
Modular/
418X.cs
View file @
819bd750
...
@@ -54,86 +54,79 @@ namespace ModbusDemo
...
@@ -54,86 +54,79 @@ namespace ModbusDemo
public
string
[]
Value
(
ushort
[]
typeData
,
ushort
[]
Inputtype
)
public
string
[]
Value
(
ushort
[]
typeData
,
ushort
[]
Inputtype
)
{
{
string
[]
Valuepass
=
new
string
[
MAX_AN_CH_NUM
];
string
[]
Valuepass
=
new
string
[
MAX_AN_CH_NUM
];
if
(
typeData
!=
null
||
Inputtype
!=
null
)
/********************/
{
users
.
UserId
=
0
;
//通道
/********************/
users
.
Data
=
typeData
[
0
];
//数据
users
.
UserId
=
0
;
//通道
users
.
UserCompany
=
Strcom
[
Inputtype
[
0
]];
//通道类型
users
.
Data
=
typeData
[
0
];
//数据
users
.
UserModel
=
Inputtype
[
0
];
//确定计算公式
users
.
UserCompany
=
Strcom
[
Inputtype
[
0
]];
//通道类型
/********************/
users
.
UserModel
=
Inputtype
[
0
];
//确定计算公式
users1
.
UserId
=
1
;
//通道
/********************/
users1
.
Data
=
typeData
[
1
];
//数据
users1
.
UserId
=
1
;
//通道
users1
.
UserCompany
=
Strcom
[
Inputtype
[
1
]];
//通道类型
users1
.
Data
=
typeData
[
1
];
//数据
users1
.
UserModel
=
Inputtype
[
1
];
//确定计算公式
users1
.
UserCompany
=
Strcom
[
Inputtype
[
1
]];
//通道类型
/********************/
users1
.
UserModel
=
Inputtype
[
1
];
//确定计算公式
users2
.
UserId
=
2
;
//通道
/********************/
users2
.
Data
=
typeData
[
2
];
//数据
users2
.
UserId
=
2
;
//通道
users2
.
UserCompany
=
Strcom
[
Inputtype
[
2
]];
//通道类型
users2
.
Data
=
typeData
[
2
];
//数据
users2
.
UserModel
=
Inputtype
[
2
];
//确定计算公式
users2
.
UserCompany
=
Strcom
[
Inputtype
[
2
]];
//通道类型
/********************/
users2
.
UserModel
=
Inputtype
[
2
];
//确定计算公式
users3
.
UserId
=
3
;
//通道
/********************/
users3
.
Data
=
typeData
[
3
];
//数据
users3
.
UserId
=
3
;
//通道
users3
.
UserCompany
=
Strcom
[
Inputtype
[
3
]];
//通道类型
users3
.
Data
=
typeData
[
3
];
//数据
users3
.
UserModel
=
Inputtype
[
3
];
//确定计算公式
users3
.
UserCompany
=
Strcom
[
Inputtype
[
3
]];
//通道类型
/********************/
users3
.
UserModel
=
Inputtype
[
3
];
//确定计算公式
users4
.
UserId
=
4
;
//通道
/********************/
users4
.
Data
=
typeData
[
4
];
//数据
users4
.
UserId
=
4
;
//通道
users4
.
UserCompany
=
Strcom
[
Inputtype
[
4
]];
//通道类型
users4
.
Data
=
typeData
[
4
];
//数据
users4
.
UserModel
=
Inputtype
[
4
];
//确定计算公式
users4
.
UserCompany
=
Strcom
[
Inputtype
[
4
]];
//通道类型
/********************/
users4
.
UserModel
=
Inputtype
[
4
];
//确定计算公式
users5
.
UserId
=
5
;
//通道
/********************/
users5
.
Data
=
typeData
[
5
];
//数据
users5
.
UserId
=
5
;
//通道
users5
.
UserCompany
=
Strcom
[
Inputtype
[
5
]];
//通道类型
users5
.
Data
=
typeData
[
5
];
//数据
users5
.
UserModel
=
Inputtype
[
5
];
//确定计算公式
users5
.
UserCompany
=
Strcom
[
Inputtype
[
5
]];
//通道类型
/********************/
users5
.
UserModel
=
Inputtype
[
5
];
//确定计算公式
users6
.
UserId
=
6
;
//通道
/********************/
users6
.
Data
=
typeData
[
6
];
//数据
users6
.
UserId
=
6
;
//通道
users6
.
UserCompany
=
Strcom
[
Inputtype
[
6
]];
//通道类型
users6
.
Data
=
typeData
[
6
];
//数据
users6
.
UserModel
=
Inputtype
[
6
];
//确定计算公式
users6
.
UserCompany
=
Strcom
[
Inputtype
[
6
]];
//通道类型
/********************/
users6
.
UserModel
=
Inputtype
[
6
];
//确定计算公式
users7
.
UserId
=
7
;
//通道
/********************/
users7
.
Data
=
typeData
[
7
];
//数据
users7
.
UserId
=
7
;
//通道
users7
.
UserCompany
=
Strcom
[
Inputtype
[
7
]];
//通道类型
users7
.
Data
=
typeData
[
7
];
//数据
users7
.
UserModel
=
Inputtype
[
7
];
//确定计算公式
users7
.
UserCompany
=
Strcom
[
Inputtype
[
7
]];
//通道类型
users7
.
UserModel
=
Inputtype
[
7
];
//确定计算公式
//////输入格式为:NegMin NegMax PosMin PosMax usMin usMax
//////输入格式为:NegMin NegMax PosMin PosMax usMin usMax
Valuepass
[
0
]
=
current
(
users
.
NegMin
[
users
.
UserModel
],
users
.
NegMax
[
users
.
UserModel
],
users
.
PosMin
[
users
.
UserModel
],
Valuepass
[
0
]
=
current
(
users
.
NegMin
[
users
.
UserModel
],
users
.
NegMax
[
users
.
UserModel
],
users
.
PosMin
[
users
.
UserModel
],
users
.
PosMax
[
users
.
UserModel
],
users
.
usMin
[
users
.
UserModel
],
users
.
usMax
[
users
.
UserModel
],
users
.
PosMax
[
users
.
UserModel
],
users
.
usMin
[
users
.
UserModel
],
users
.
usMax
[
users
.
UserModel
],
users
.
Data
);
//处理函数
users
.
Data
);
//处理函数
Valuepass
[
1
]
=
current
(
users1
.
NegMin
[
users1
.
UserModel
],
users1
.
NegMax
[
users1
.
UserModel
],
users1
.
PosMin
[
users1
.
UserModel
],
Valuepass
[
1
]
=
current
(
users1
.
NegMin
[
users1
.
UserModel
],
users1
.
NegMax
[
users1
.
UserModel
],
users1
.
PosMin
[
users1
.
UserModel
],
users1
.
PosMax
[
users1
.
UserModel
],
users1
.
usMin
[
users1
.
UserModel
],
users1
.
usMax
[
users1
.
UserModel
],
users1
.
PosMax
[
users1
.
UserModel
],
users1
.
usMin
[
users1
.
UserModel
],
users1
.
usMax
[
users1
.
UserModel
],
users1
.
Data
);
//处理函数
users1
.
Data
);
//处理函数
Valuepass
[
2
]
=
current
(
users2
.
NegMin
[
users2
.
UserModel
],
users2
.
NegMax
[
users2
.
UserModel
],
users2
.
PosMin
[
users2
.
UserModel
],
Valuepass
[
2
]
=
current
(
users2
.
NegMin
[
users2
.
UserModel
],
users2
.
NegMax
[
users2
.
UserModel
],
users2
.
PosMin
[
users2
.
UserModel
],
users2
.
PosMax
[
users2
.
UserModel
],
users2
.
usMin
[
users2
.
UserModel
],
users2
.
usMax
[
users2
.
UserModel
],
users2
.
PosMax
[
users2
.
UserModel
],
users2
.
usMin
[
users2
.
UserModel
],
users2
.
usMax
[
users2
.
UserModel
],
users2
.
Data
);
//处理函数
users2
.
Data
);
//处理函数
Valuepass
[
3
]
=
current
(
users3
.
NegMin
[
users3
.
UserModel
],
users3
.
NegMax
[
users3
.
UserModel
],
users3
.
PosMin
[
users3
.
UserModel
],
Valuepass
[
3
]
=
current
(
users3
.
NegMin
[
users3
.
UserModel
],
users3
.
NegMax
[
users3
.
UserModel
],
users3
.
PosMin
[
users3
.
UserModel
],
users3
.
PosMax
[
users3
.
UserModel
],
users3
.
usMin
[
users3
.
UserModel
],
users3
.
usMax
[
users3
.
UserModel
],
users3
.
PosMax
[
users3
.
UserModel
],
users3
.
usMin
[
users3
.
UserModel
],
users3
.
usMax
[
users3
.
UserModel
],
users3
.
Data
);
//处理函数
users3
.
Data
);
//处理函数
Valuepass
[
4
]
=
current
(
users4
.
NegMin
[
users4
.
UserModel
],
users4
.
NegMax
[
users4
.
UserModel
],
users4
.
PosMin
[
users4
.
UserModel
],
Valuepass
[
4
]
=
current
(
users4
.
NegMin
[
users4
.
UserModel
],
users4
.
NegMax
[
users4
.
UserModel
],
users4
.
PosMin
[
users4
.
UserModel
],
users4
.
PosMax
[
users4
.
UserModel
],
users4
.
usMin
[
users4
.
UserModel
],
users4
.
usMax
[
users4
.
UserModel
],
users4
.
PosMax
[
users4
.
UserModel
],
users4
.
usMin
[
users4
.
UserModel
],
users4
.
usMax
[
users4
.
UserModel
],
users4
.
Data
);
//处理函数
users4
.
Data
);
//处理函数
Valuepass
[
5
]
=
current
(
users5
.
NegMin
[
users5
.
UserModel
],
users5
.
NegMax
[
users5
.
UserModel
],
users5
.
PosMin
[
users5
.
UserModel
],
Valuepass
[
5
]
=
current
(
users5
.
NegMin
[
users5
.
UserModel
],
users5
.
NegMax
[
users5
.
UserModel
],
users5
.
PosMin
[
users5
.
UserModel
],
users5
.
PosMax
[
users5
.
UserModel
],
users5
.
usMin
[
users5
.
UserModel
],
users5
.
usMax
[
users5
.
UserModel
],
users5
.
PosMax
[
users5
.
UserModel
],
users5
.
usMin
[
users5
.
UserModel
],
users5
.
usMax
[
users5
.
UserModel
],
users5
.
Data
);
//处理函数
users5
.
Data
);
//处理函数
Valuepass
[
6
]
=
current
(
users6
.
NegMin
[
users6
.
UserModel
],
users6
.
NegMax
[
users6
.
UserModel
],
users6
.
PosMin
[
users6
.
UserModel
],
Valuepass
[
6
]
=
current
(
users6
.
NegMin
[
users6
.
UserModel
],
users6
.
NegMax
[
users6
.
UserModel
],
users6
.
PosMin
[
users6
.
UserModel
],
users6
.
PosMax
[
users6
.
UserModel
],
users6
.
usMin
[
users6
.
UserModel
],
users6
.
usMax
[
users6
.
UserModel
],
users6
.
PosMax
[
users6
.
UserModel
],
users6
.
usMin
[
users6
.
UserModel
],
users6
.
usMax
[
users6
.
UserModel
],
users6
.
Data
);
//处理函数
users6
.
Data
);
//处理函数
Valuepass
[
7
]
=
current
(
users7
.
NegMin
[
users7
.
UserModel
],
users7
.
NegMax
[
users7
.
UserModel
],
users7
.
PosMin
[
users7
.
UserModel
],
Valuepass
[
7
]
=
current
(
users7
.
NegMin
[
users7
.
UserModel
],
users7
.
NegMax
[
users7
.
UserModel
],
users7
.
PosMin
[
users7
.
UserModel
],
users7
.
PosMax
[
users7
.
UserModel
],
users7
.
usMin
[
users7
.
UserModel
],
users7
.
usMax
[
users7
.
UserModel
],
users7
.
PosMax
[
users7
.
UserModel
],
users7
.
usMin
[
users7
.
UserModel
],
users7
.
usMax
[
users7
.
UserModel
],
users7
.
Data
);
//处理函数
users7
.
Data
);
//处理函数
}
else
{
Valuepass
=
null
;
}
return
Valuepass
;
return
Valuepass
;
}
}
...
@@ -262,7 +255,7 @@ namespace ModbusDemo
...
@@ -262,7 +255,7 @@ namespace ModbusDemo
/*****************有效判断*****************************/
/*****************有效判断*****************************/
if
(
text
[
0
]
==
"0.000"
)
if
(
text
[
0
]
==
"0.000"
)
{
{
text
[
0
]
=
"
0
"
;
text
[
0
]
=
"
Burn_out
"
;
return
text
;
return
text
;
}
}
else
else
...
...
ModbusDemo/478C.cs
→
ModbusDemo/
Modular/
478C.cs
View file @
819bd750
File moved
ModbusDemo/Program.cs
View file @
819bd750
...
@@ -14,13 +14,9 @@ namespace ModbusDemo
...
@@ -14,13 +14,9 @@ namespace ModbusDemo
[
STAThread
]
[
STAThread
]
static
void
Main
()
static
void
Main
()
{
{
Application
.
EnableVisualStyles
();
Application
.
EnableVisualStyles
();
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
SetCompatibleTextRenderingDefault
(
false
);
Application
.
Run
(
new
Form1
());
Application
.
Run
(
new
Form1
());
//Application.Run(new Demo_818X());
//Application.Run(new ProTest());
//Application.Run(new MDemo());
}
}
}
}
}
}
ModbusDemo/application/Pond.cs
0 → 100644
View file @
819bd750
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows.Forms
;
using
ModbusDemo
;
namespace
ModbusDemo.application
{
class
Pond
{
private
string
Sname
;
//池子的名称
private
bool
state
;
private
double
Dlevel
;
//池子的液位
private
double
Lowwaterlevel
;
//液位最低水位
private
double
Peaklevel
;
//液位最高水位
private
string
Agitator
;
//搅拌器
private
ushort
current
;
//电流
private
ushort
Voltage
;
//电压
public
string
Sname1
{
get
=>
Sname
;
set
=>
Sname
=
value
;
}
public
bool
State
{
get
=>
state
;
set
=>
state
=
value
;
}
public
double
Dlevel1
{
get
=>
Dlevel
;
set
=>
Dlevel
=
value
;
}
public
double
Lowwaterlevel1
{
get
=>
Lowwaterlevel
;
set
=>
Lowwaterlevel
=
value
;
}
public
double
Peaklevel1
{
get
=>
Peaklevel
;
set
=>
Peaklevel
=
value
;
}
public
ushort
Voltage1
{
get
=>
Voltage
;
set
=>
Voltage
=
value
;
}
public
ushort
Current
{
get
=>
current
;
set
=>
current
=
value
;
}
public
string
Agitator1
{
get
=>
Agitator
;
set
=>
Agitator
=
value
;
}
//public class Agitator : ModbusAttribute //搅拌器
//{
// public bool state;
// public ushort[] current;//电流
// public ushort[] Voltage;//电压
//}
//public class pump : ModbusAttribute//泵
//{
// public bool state;
// public ushort[] current;//电流
// public ushort[] Voltage;//电压
//}
//public class Level : ModbusAttribute //液位属性
//{
// public ushort[] level;//液位
// public ushort[] passageway; //液位通道
// public double[] Lowwaterlevel; // 液位最低水位
// public double[] Peaklevel; // 液位最高水位
//}
//public class ModbusAttribute //modbus属性
//{
// public byte[] SlaveAddress;
// public ushort[] RegisterAddress;
//}
}
}
ModbusDemo/application/TransferPool.cs
0 → 100644
View file @
819bd750
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Timers
;
namespace
ModbusDemo.windows
{
class
TransferPool
{
public
string
position
;
//位置
public
class
Source
:
ModbusAttribute
//水源
{
public
string
Southeastwater
;
//东南水
public
string
Northeastwater
;
//东北水
public
string
Southwestwater
;
//西南水
public
string
Northwestwater
;
//西北水
public
string
Timingtime
;
//定时时间
public
bool
system_Statue
;
}
public
class
passageway
//通道
{
public
Agitator
agitator
;
public
pump
pump
;
public
Level
Level
;
//液位属性
}
public
class
Agitator
:
ModbusAttribute
//搅拌器
{
public
bool
state
;
public
ushort
[]
current
;
//电流
public
ushort
[]
Voltage
;
//电压
}
public
class
pump
:
ModbusAttribute
//泵
{
public
bool
state
;
public
ushort
[]
current
;
//电流
public
ushort
[]
Voltage
;
//电压
}
public
class
Level
:
ModbusAttribute
//液位属性
{
public
ushort
[]
level
;
//液位
public
ushort
[]
passageway
;
//液位通道
public
double
[]
Lowwaterlevel
;
// 液位最低水位
public
double
[]
Peaklevel
;
// 液位最高水位
}
public
class
ModbusAttribute
//modbus属性
{
public
byte
[]
SlaveAddress
;
public
ushort
[]
RegisterAddress
;
}
}
}
ModbusDemo/windows/Form1.cs
View file @
819bd750
This diff is collapsed.
Click to expand it.
ModbusDemo/windows/frmInputValue.Designer.cs
deleted
100644 → 0
View file @
b5267af2
This diff is collapsed.
Click to expand it.
ModbusDemo/windows/frmInputValue.cs
deleted
100644 → 0
View file @
b5267af2
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Drawing
;
using
System.Text
;
using
System.Windows.Forms
;
namespace
ModbusRTU_Master
{
public
partial
class
frmInputValue
:
Form
{
public
frmInputValue
()
{
InitializeComponent
();
}
public
double
Value
{
set
{
this
.
txtValue
.
Text
=
value
.
ToString
();
}
get
{
return
Convert_To_Double
(
this
.
txtValue
.
Text
);
}
}
public
string
StringValue
{
set
{
this
.
txtValue
.
Text
=
value
;
}
get
{
return
this
.
txtValue
.
Text
;
}
}
private
double
Convert_To_Double
(
string
sKey
)
{
if
(
sKey
==
""
)
sKey
=
"0"
;
return
double
.
Parse
(
sKey
);
}
private
void
Number_Click
(
object
sender
,
EventArgs
e
)
{
txtValue
.
Text
=
txtValue
.
Text
+
((
Button
)
sender
).
Tag
;
}
private
void
btcommon_Click
(
object
sender
,
EventArgs
e
)
{
if
(
txtValue
.
Text
.
IndexOf
(
"."
)
<
0
)
txtValue
.
Text
+=
"."
;
}
private
void
btdel_Click
(
object
sender
,
EventArgs
e
)
{
txtValue
.
Text
=
txtValue
.
Text
.
Substring
(
0
,
txtValue
.
Text
.
Length
-
1
);
}
private
void
btClr_Click
(
object
sender
,
EventArgs
e
)
{
txtValue
.
Text
=
""
;
}
private
void
btMinus_Click
(
object
sender
,
EventArgs
e
)
{
if
(
Convert_To_Double
(
txtValue
.
Text
)
>
0
)
{
txtValue
.
Text
=
(
Convert_To_Double
(
txtValue
.
Text
)
*
(-
1
)).
ToString
();
}
}
private
void
btPlus_Click
(
object
sender
,
EventArgs
e
)
{
if
(
Convert_To_Double
(
txtValue
.
Text
)
<
0
)
{
txtValue
.
Text
=
(
Convert_To_Double
(
txtValue
.
Text
)
*
(-
1
)).
ToString
();
}
}
}
}
\ No newline at end of file
ModbusDemo/windows/frmInputValue.resx
deleted
100644 → 0
View file @
b5267af2
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema
id=
"root"
xmlns=
""
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:msdata=
"urn:schemas-microsoft-com:xml-msdata"
>
<xsd:import
namespace=
"http://www.w3.org/XML/1998/namespace"
/>
<xsd:element
name=
"root"
msdata:IsDataSet=
"true"
>
<xsd:complexType>
<xsd:choice
maxOccurs=
"unbounded"
>
<xsd:element
name=
"metadata"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
use=
"required"
type=
"xsd:string"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"assembly"
>
<xsd:complexType>
<xsd:attribute
name=
"alias"
type=
"xsd:string"
/>
<xsd:attribute
name=
"name"
type=
"xsd:string"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"data"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
<xsd:element
name=
"comment"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"2"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
msdata:Ordinal=
"1"
/>
<xsd:attribute
name=
"type"
type=
"xsd:string"
msdata:Ordinal=
"3"
/>
<xsd:attribute
name=
"mimetype"
type=
"xsd:string"
msdata:Ordinal=
"4"
/>
<xsd:attribute
ref=
"xml:space"
/>
</xsd:complexType>
</xsd:element>
<xsd:element
name=
"resheader"
>
<xsd:complexType>
<xsd:sequence>
<xsd:element
name=
"value"
type=
"xsd:string"
minOccurs=
"0"
msdata:Ordinal=
"1"
/>
</xsd:sequence>
<xsd:attribute
name=
"name"
type=
"xsd:string"
use=
"required"
/>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader
name=
"resmimetype"
>
<value>
text/microsoft-resx
</value>
</resheader>
<resheader
name=
"version"
>
<value>
2.0
</value>
</resheader>
<resheader
name=
"reader"
>
<value>
System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader
name=
"writer"
>
<value>
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
</value>
</resheader>
</root>
\ No newline at end of file
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