1 Commits

Author SHA1 Message Date
nikzori
a283537d5e fixed app crash for Standard Radio 2025-06-24 12:05:20 +03:00
2 changed files with 30 additions and 27 deletions

View File

@@ -210,34 +210,36 @@ namespace Gidrolock_Modbus_Scanner
} }
} }
if (device.wspPlusMode != null || device.wspPlusMode.Count > 0) if (device.wspPlusMode != null)
{ if (device.wspPlusMode.Count > 0)
for(int i = 0; i < device.wspPlusMode.Count; i++)
{ {
res = PollEntry(device.wspPlusMode[i]); for(int i = 0; i < device.wspPlusMode.Count; i++)
if (res)
{ {
bool value = latestMessage.Data[0] > 0x00 ? true : false; res = PollEntry(device.wspPlusMode[i]);
WiredSensor snsr = sensorPanel.Controls[i] as WiredSensor; if (res)
snsr.Invoke(new MethodInvoker(delegate { snsr.wspPlusCheckbox.Checked = value; })); {
bool value = latestMessage.Data[0] > 0x00 ? true : false;
WiredSensor snsr = sensorPanel.Controls[i] as WiredSensor;
snsr.Invoke(new MethodInvoker(delegate { snsr.wspPlusCheckbox.Checked = value; }));
}
} }
} }
}
if (device.wiredLineBreak != null || device.wiredLineBreak.Count > 0) if (device.wiredLineBreak != null)
{ if(device.wiredLineBreak.Count > 0)
for (int i = 0; i < device.wiredLineBreak.Count; i++)
{ {
res = PollEntry(device.wiredLineBreak[i]); for (int i = 0; i < device.wiredLineBreak.Count; i++)
if (res)
{ {
bool value = latestMessage.Data[0] > 0x00 ? true : false; res = PollEntry(device.wiredLineBreak[i]);
WiredSensor snsr = sensorPanel.Controls[i] as WiredSensor; if (res)
snsr.Invoke(new MethodInvoker(delegate { snsr.labelBreak.Text = value ? "Обрыв!" : "ОК"; })); {
bool value = latestMessage.Data[0] > 0x00 ? true : false;
WiredSensor snsr = sensorPanel.Controls[i] as WiredSensor;
snsr.Invoke(new MethodInvoker(delegate { snsr.labelBreak.Text = value ? "Обрыв!" : "ОК"; }));
}
} }
} }
}
res = PollEntry(device.sensorAlarm); res = PollEntry(device.sensorAlarm);
if (res) if (res)
@@ -657,14 +659,15 @@ namespace Gidrolock_Modbus_Scanner
labelBreakFluff.Text = "Обрыв:"; labelBreakFluff.Text = "Обрыв:";
labelBreak.Text = "неизвестно"; labelBreak.Text = "неизвестно";
if (device.wspPlusMode != null || device.wspPlusMode.Count > 0) if (device.wspPlusMode != null)
{ if (device.wspPlusMode.Count > 0)
labelWSPPlusFluff = new Label() { Width = 45, Height = 24, Text = "WSP+:" }; {
wspPlusCheckbox = new CheckBox() { Width = 20, Height = 14, Margin = Padding.Empty }; labelWSPPlusFluff = new Label() { Width = 45, Height = 24, Text = "WSP+:" };
wspPlusCheckbox = new CheckBox() { Width = 20, Height = 14, Margin = Padding.Empty };
this.Controls.Add(labelWSPPlusFluff); this.Controls.Add(labelWSPPlusFluff);
this.Controls.Add(wspPlusCheckbox); this.Controls.Add(wspPlusCheckbox);
} }
} }
} }

View File

@@ -30,6 +30,6 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("1.1.0.0")] [assembly: AssemblyVersion("1.1.1.0")]
[assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyFileVersion("1.1.1.0")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]