Combination of data from the current route, from digital outputs and from UI modified, ver. 3.1.1642

This commit is contained in:
Milan Hanajik
2021-05-04 14:10:25 +02:00
parent fc95847377
commit 3a2ab6c286
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number // Build Number
// Revision // Revision
// //
[assembly: AssemblyVersion("3.1.1641.0")] [assembly: AssemblyVersion("3.1.1642.0")]
[assembly: AssemblyFileVersion("3.1.1641.0")] [assembly: AssemblyFileVersion("3.1.1642.0")]
+4 -2
View File
@@ -246,6 +246,7 @@ namespace TBF.Rig.ControlBoard.Uni
/// ///
/// Read data from the control board /// Read data from the control board
/// ///
bool generalDataReceived = false;
if (cbCfg.DebugLevel == DebugMode.Normal && serialPort != null && serialPort.IsOpen) if (cbCfg.DebugLevel == DebugMode.Normal && serialPort != null && serialPort.IsOpen)
{ {
/// Read new received bytes and append them to a buffer /// Read new received bytes and append them to a buffer
@@ -285,6 +286,7 @@ namespace TBF.Rig.ControlBoard.Uni
else if (GeneralData.FrameFitsData(rcvdData, cumulativeSums, rcvdBytesCount, offset)) else if (GeneralData.FrameFitsData(rcvdData, cumulativeSums, rcvdBytesCount, offset))
{ {
/// Regular data received /// Regular data received
generalDataReceived = true;
Data.UpdateData(rcvdData, offset); Data.UpdateData(rcvdData, offset);
msg = Telegram.LogTelegram("General data ", rcvdData, offset, GeneralData.MessageLen); msg = Telegram.LogTelegram("General data ", rcvdData, offset, GeneralData.MessageLen);
offset += GeneralData.MessageLen; offset += GeneralData.MessageLen;
@@ -335,7 +337,7 @@ namespace TBF.Rig.ControlBoard.Uni
/// ///
lock (this) lock (this)
{ {
route = (UInt128)(Data.Vystupy ^ valvesToInvert); if (generalDataReceived) route = (UInt128)(Data.Vystupy ^ valvesToInvert);
/// ///
if (!IsUIBlocked && bitsChangedByUI != 0) if (!IsUIBlocked && bitsChangedByUI != 0)
{ {
@@ -377,7 +379,7 @@ namespace TBF.Rig.ControlBoard.Uni
{ {
DateTime now = DateTime.Now; DateTime now = DateTime.Now;
if (now < lastSentTime + TimeSpan.FromSeconds(0.8) || if (now < lastSentTime + TimeSpan.FromSeconds(0.8) ||
(lastReceivedTime < lastSentTime && now < lastSentTime + TimeSpan.FromSeconds(2.5))) (lastReceivedTime < lastSentTime && now < lastSentTime + TimeSpan.FromSeconds(1.7)))
{ {
log.Error("RunDeviceAfter() ... skipping too early write of a serial command or a data requect"); log.Error("RunDeviceAfter() ... skipping too early write of a serial command or a data requect");
return; return;