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
+4 -2
View File
@@ -246,6 +246,7 @@ namespace TBF.Rig.ControlBoard.Uni
///
/// Read data from the control board
///
bool generalDataReceived = false;
if (cbCfg.DebugLevel == DebugMode.Normal && serialPort != null && serialPort.IsOpen)
{
/// 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))
{
/// Regular data received
generalDataReceived = true;
Data.UpdateData(rcvdData, offset);
msg = Telegram.LogTelegram("General data ", rcvdData, offset, GeneralData.MessageLen);
offset += GeneralData.MessageLen;
@@ -335,7 +337,7 @@ namespace TBF.Rig.ControlBoard.Uni
///
lock (this)
{
route = (UInt128)(Data.Vystupy ^ valvesToInvert);
if (generalDataReceived) route = (UInt128)(Data.Vystupy ^ valvesToInvert);
///
if (!IsUIBlocked && bitsChangedByUI != 0)
{
@@ -377,7 +379,7 @@ namespace TBF.Rig.ControlBoard.Uni
{
DateTime now = DateTime.Now;
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");
return;