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
3fd90cd4
Commit
3fd90cd4
authored
Jun 17, 2019
by
GhediChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Control %10
parent
b8dca831
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
7 deletions
+42
-7
ModbusDemo.csproj
ModbusDemo/ModbusDemo.csproj
+1
-2
AutoControl.cs
ModbusDemo/application/AutoControl.cs
+3
-3
TransferPool.cs
ModbusDemo/application/TransferPool.cs
+1
-0
Form1.cs
ModbusDemo/windows/Form1.cs
+37
-2
No files found.
ModbusDemo/ModbusDemo.csproj
View file @
3fd90cd4
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
<Compile
Include=
"Common\ModualAlarm.cs"
/>
<Compile
Include=
"Common\ModualAlarm.cs"
/>
<Compile
Include=
"Common\OperIni.cs"
/>
<Compile
Include=
"Common\OperIni.cs"
/>
<Compile
Include=
"MessageFormat\ModbusComm.cs"
/>
<Compile
Include=
"MessageFormat\ModbusComm.cs"
/>
<Compile
Include=
"MessageFormat\ModualControl.cs"
/>
<Compile
Include=
"Modular\414P.cs"
/>
<Compile
Include=
"Modular\414P.cs"
/>
<Compile
Include=
"Modular\478C.cs"
/>
<Compile
Include=
"Modular\478C.cs"
/>
<Compile
Include=
"Modular\418X.cs"
/>
<Compile
Include=
"Modular\418X.cs"
/>
...
@@ -172,8 +173,6 @@
...
@@ -172,8 +173,6 @@
<PropertyGroup>
<PropertyGroup>
<SsdtUnitTestVersion>
3.1
</SsdtUnitTestVersion>
<SsdtUnitTestVersion>
3.1
</SsdtUnitTestVersion>
</PropertyGroup>
</PropertyGroup>
<Import
Project=
"$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets"
Condition=
"$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' != ''"
/>
<Import
Project=
"$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.Sql.UnitTesting.targets"
Condition=
"$(VisualStudioVersion) != '15.0' And '$(SQLDBExtensionsRefPath)' == ''"
/>
<PropertyGroup>
<PropertyGroup>
<SsdtUnitTestVersion>
3.1
</SsdtUnitTestVersion>
<SsdtUnitTestVersion>
3.1
</SsdtUnitTestVersion>
</PropertyGroup>
</PropertyGroup>
...
...
ModbusDemo/application/AutoControl.cs
View file @
3fd90cd4
...
@@ -24,9 +24,9 @@ namespace ModbusDemo.application
...
@@ -24,9 +24,9 @@ namespace ModbusDemo.application
public
class
Control
:
Status
public
class
Control
:
Status
{
{
public
bool
Enablation
;
public
bool
Enablation
;
public
float
maxLevel
;
public
double
maxLevel
;
public
float
minLevel
;
public
double
minLevel
;
public
float
DifferenceValue
;
public
double
DifferenceValue
;
public
double
realTimeLevel
;
public
double
realTimeLevel
;
public
bool
status
;
public
bool
status
;
public
string
Name
;
public
string
Name
;
...
...
ModbusDemo/application/TransferPool.cs
View file @
3fd90cd4
...
@@ -36,6 +36,7 @@ namespace ModbusDemo.windows
...
@@ -36,6 +36,7 @@ namespace ModbusDemo.windows
public
bool
state
;
public
bool
state
;
public
ushort
[]
current
;
//电流
public
ushort
[]
current
;
//电流
public
ushort
[]
Voltage
;
//电压
public
ushort
[]
Voltage
;
//电压
}
}
public
class
Level
:
ModbusAttribute
//液位属性
public
class
Level
:
ModbusAttribute
//液位属性
...
...
ModbusDemo/windows/Form1.cs
View file @
3fd90cd4
...
@@ -982,8 +982,43 @@ namespace ModbusDemo
...
@@ -982,8 +982,43 @@ namespace ModbusDemo
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
private
void
button2_Click
(
object
sender
,
EventArgs
e
)
{
{
ModualPoll
.
vAllNodePoll
();
AutoControl
.
Control
usEcontrol
=
new
AutoControl
.
Control
();
mqttData
=
ModualPoll
.
stAll_Poll_Package
();
AutoControl
.
Control
usWcontrol
=
new
AutoControl
.
Control
();
if
(
ModualControl
.
cPoolLevelConfig
.
Count
!=
0
)
{
for
(
int
i
=
0
;
i
<
ModualControl
.
cPoolLevelConfig
.
Count
;
i
++)
{
if
(
ModualControl
.
cPoolLevelConfig
[
i
].
byModbusID
==
6
)
{
usWcontrol
.
maxLevel
=
ModualControl
.
cPoolLevelConfig
[
i
].
dUpLevel
;
usWcontrol
.
minLevel
=
ModualControl
.
cPoolLevelConfig
[
i
].
dDownLevel
;
usWcontrol
.
Name
=
"西·中转池"
;
usWcontrol
.
Enablation
=
true
;
AutoControl
.
CriticalValueMonitoring
(
true
,
ModualControl
.
cPoolLevelConfig
[
1
].
dUpLevel
,
ModualControl
.
cPoolLevelConfig
[
0
].
dDownLevel
,
ModualPoll
.
cx18x
.
sX18xDataStruct
[
1
].
dNowConvertData
[
1
],
"西·中转池"
,
out
usWcontrol
);
}
if
(
ModualControl
.
cPoolLevelConfig
[
i
].
byModbusID
==
3
)
{
usEcontrol
.
maxLevel
=
ModualControl
.
cPoolLevelConfig
[
i
].
dUpLevel
;
usEcontrol
.
minLevel
=
ModualControl
.
cPoolLevelConfig
[
i
].
dDownLevel
;
usEcontrol
.
Name
=
"东·中转池"
;
usEcontrol
.
Enablation
=
true
;
AutoControl
.
CriticalValueMonitoring
(
true
,
ModualControl
.
cPoolLevelConfig
[
0
].
dUpLevel
,
ModualControl
.
cPoolLevelConfig
[
0
].
dDownLevel
,
ModualPoll
.
cx18x
.
sX18xDataStruct
[
0
].
dNowConvertData
[
0
],
"东·中转池"
,
out
usEcontrol
);
}
}
}
}
}
private
async
void
SubscribeBut_Click
(
object
sender
,
EventArgs
e
)
private
async
void
SubscribeBut_Click
(
object
sender
,
EventArgs
e
)
...
...
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