Bug fixes : (1) UniCB timing after a delay in worker thread (DB request), (2) Scales.MettlerToledo.ScaleCfg, ver. 3.1.1806

This commit is contained in:
Milan Hanajik 2021-11-11 12:11:34 +01:00
parent 335fce3e39
commit 51b3e994c3
4 changed files with 7 additions and 11 deletions

View File

@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("3.1.1805.0")]
[assembly: AssemblyFileVersion("3.1.1805.0")]
[assembly: AssemblyVersion("3.1.1806.0")]
[assembly: AssemblyFileVersion("3.1.1806.0")]

View File

@ -472,14 +472,6 @@ namespace TBF.Rig.ControlBoard.Uni
/// </summary>
public void RunDeviceAfter()
{
DateTime now = DateTime.Now;
if (now < lastSentTime + TimeSpan.FromSeconds(0.7) ||
(lastReceivedTime < lastSentTime && now < lastSentTime + TimeSpan.FromSeconds(1.7)))
{
log.Error("RunDeviceAfter() ... skipping too early write of a serial command or a data requect");
return;
}
///
/// Combine data from the current route and from UI
///

View File

@ -277,6 +277,7 @@ namespace TBF.Rig.Scales.MettlerToledo
if (Utils.TryParseUFloat(strValue, out fdummy)) return true;
break;
case 13: /// Evaporation
return true;
default:
message = "Invalid index";
return false;

View File

@ -836,7 +836,10 @@ namespace TBF.Rig
/// <returns>true when interrupted by 'quitStateMachine', otherwise false</returns>
public static void WaitNextTick()
{
currentTimeSec += Period;
int currentTimeSecFromClock = Convert.ToInt32(Math.Round((DateTime.Now - startDateTime).TotalSeconds - 0.2));
currentTimeSec = Math.Max(currentTimeSec, currentTimeSecFromClock) + Period;
DateTime nextTickDateTime = startDateTime + TimeSpan.FromSeconds(currentTimeSec);
while (DateTime.Now < nextTickDateTime)