added line break polling
This commit is contained in:
14
Datasheet.cs
14
Datasheet.cs
@@ -194,6 +194,20 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (device.wiredLineBreak != null || device.wiredLineBreak.Count > 0)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < device.wiredLineBreak.Count; i++)
|
||||||
|
{
|
||||||
|
res = await PollEntry(device.wiredLineBreak[i]);
|
||||||
|
if (res)
|
||||||
|
{
|
||||||
|
bool value = latestMessage.Data[0] > 0x00 ? true : false;
|
||||||
|
WiredSensor snsr = sensorPanel.Controls[i] as WiredSensor;
|
||||||
|
snsr.labelBreak.Text = value ? "Обрыв!" : "ОК";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
res = await PollEntry(device.sensorAlarm);
|
res = await PollEntry(device.sensorAlarm);
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{47A399D3-30C1-4EF4-9E94-F3518919A59C}</ProjectGuid>
|
<ProjectGuid>{47A399D3-30C1-4EF4-9E94-F3518919A59C}</ProjectGuid>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<RootNamespace>Gidrolock_Modbus_Scanner</RootNamespace>
|
<RootNamespace>Gidrolock_Modbus_Configurator</RootNamespace>
|
||||||
<AssemblyName>Gidrolock Modbus Configurator</AssemblyName>
|
<AssemblyName>Gidrolock Modbus Configurator</AssemblyName>
|
||||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||||
<FileAlignment>512</FileAlignment>
|
<FileAlignment>512</FileAlignment>
|
||||||
|
|||||||
22
Main.cs
22
Main.cs
@@ -316,7 +316,11 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
d.wiredSensors = 2;
|
d.wiredSensors = 2;
|
||||||
d.hasScenarioSensor = true;
|
d.hasScenarioSensor = true;
|
||||||
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 24);
|
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 24);
|
||||||
|
d.wiredLineBreak = new List<Entry>()
|
||||||
|
{
|
||||||
|
new Entry(RegisterType.Discrete, 1205),
|
||||||
|
new Entry(RegisterType.Discrete, 1207)
|
||||||
|
};
|
||||||
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -338,7 +342,11 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
d.wiredSensors = 2;
|
d.wiredSensors = 2;
|
||||||
d.hasScenarioSensor = false;
|
d.hasScenarioSensor = false;
|
||||||
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 23);
|
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 23);
|
||||||
|
d.wiredLineBreak = new List<Entry>()
|
||||||
|
{
|
||||||
|
new Entry(RegisterType.Discrete, 1205),
|
||||||
|
new Entry(RegisterType.Discrete, 1207)
|
||||||
|
};
|
||||||
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -367,6 +375,16 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
d.wiredSensors = 7;
|
d.wiredSensors = 7;
|
||||||
d.hasScenarioSensor = true;
|
d.hasScenarioSensor = true;
|
||||||
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 29);
|
d.sensorAlarm = new Entry(RegisterType.Discrete, 1343, 29);
|
||||||
|
d.wiredLineBreak = new List<Entry>()
|
||||||
|
{
|
||||||
|
new Entry(RegisterType.Discrete, 1025),
|
||||||
|
new Entry(RegisterType.Discrete, 1026),
|
||||||
|
new Entry(RegisterType.Discrete, 1027),
|
||||||
|
new Entry(RegisterType.Discrete, 1028),
|
||||||
|
new Entry(RegisterType.Discrete, 1029),
|
||||||
|
new Entry(RegisterType.Discrete, 1030),
|
||||||
|
new Entry(RegisterType.Discrete, 1031),
|
||||||
|
};
|
||||||
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
d.radioStatus = new Entry(RegisterType.Input, 1215, 21);
|
||||||
break;
|
break;
|
||||||
case DeviceType.Premium:
|
case DeviceType.Premium:
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
stopwatch.Restart();
|
stopwatch.Restart();
|
||||||
while (stopwatch.ElapsedMilliseconds < 20)
|
while (stopwatch.ElapsedMilliseconds < 50)
|
||||||
{
|
{
|
||||||
if (port.BytesToRead > 0)
|
if (port.BytesToRead > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
2
Model.cs
2
Model.cs
@@ -26,7 +26,7 @@ namespace Gidrolock_Modbus_Scanner
|
|||||||
public Entry sensorAlarm;
|
public Entry sensorAlarm;
|
||||||
|
|
||||||
public List<Entry> wiredLineBreak;
|
public List<Entry> wiredLineBreak;
|
||||||
|
|
||||||
public Entry radioStatus;
|
public Entry radioStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,6 @@ using System.Runtime.InteropServices;
|
|||||||
// Build Number
|
// Build Number
|
||||||
// Revision
|
// Revision
|
||||||
//
|
//
|
||||||
[assembly: AssemblyVersion("0.9.4.0")]
|
[assembly: AssemblyVersion("0.9.5.0")]
|
||||||
[assembly: AssemblyFileVersion("0.9.4.0")]
|
[assembly: AssemblyFileVersion("0.9.5.0")]
|
||||||
[assembly: NeutralResourcesLanguage("en")]
|
[assembly: NeutralResourcesLanguage("en")]
|
||||||
|
|||||||
4
Properties/Resources.Designer.cs
generated
4
Properties/Resources.Designer.cs
generated
@@ -8,7 +8,7 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Gidrolock_Modbus_Scanner.Properties {
|
namespace Gidrolock_Modbus_Configurator.Properties {
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ namespace Gidrolock_Modbus_Scanner.Properties {
|
|||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
if (object.ReferenceEquals(resourceMan, null)) {
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gidrolock_Modbus_Scanner.Properties.Resources", typeof(Resources).Assembly);
|
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Gidrolock_Modbus_Configurator.Properties.Resources", typeof(Resources).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
|
|||||||
2
Properties/Settings.Designer.cs
generated
2
Properties/Settings.Designer.cs
generated
@@ -8,7 +8,7 @@
|
|||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
namespace Gidrolock_Modbus_Scanner.Properties {
|
namespace Gidrolock_Modbus_Configurator.Properties {
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
|
|||||||
Reference in New Issue
Block a user