Commit 3fd90cd4 authored by GhediChan's avatar GhediChan

Add Control %10

parent b8dca831
...@@ -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>
......
...@@ -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;
......
...@@ -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 //液位属性
......
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment