Action.IsFromUI, MeasureFlow works OK, SetFlow in progress, ver. 3.1.1624

This commit is contained in:
Milan Hanajik
2021-03-10 16:51:52 +01:00
parent 6f701adb9e
commit a21766b944
39 changed files with 393 additions and 307 deletions
+9 -11
View File
@@ -3,12 +3,15 @@
///
using System;
using System.Diagnostics;
using log4net;
using Dirichlet.Numerics;
namespace TBF.Rig.ControlBoard.Uni
{
public static class OutputMessage
{
private static readonly ILog log = LogManager.GetLogger(typeof(OutputMessage));
public const int PayloadLen = 38;
public const byte MessageCode = (byte)' ';
@@ -70,9 +73,9 @@ namespace TBF.Rig.ControlBoard.Uni
message[34] = 0; /// PrudParH
message[35] = (byte)Math.Max(1, Math.Min(255, action.PID)); /// PIDRV
message[36] = (byte)Math.Max(4, Math.Min(255, action.TolerRV)); /// TolerRV (4..20 mA reg.valve only)
message[36] = 0; // (byte)Math.Max(4, Math.Min(255, action.TolerRV)); /// TolerRV (4..20 mA reg.valve only)
message[37] = (byte)Math.Max(0, Math.Min(255, action.StabTime)); /// StabRV
message[38] = (byte)((action.DivThreshold >> 2) & 0xFF); /// HranAK
message[38] = 0x1A; // (byte)((action.DivThreshold >> 2) & 0xFF); /// HranAK
message[39] = 0;
message[40] = 0;
@@ -97,21 +100,16 @@ namespace TBF.Rig.ControlBoard.Uni
{
int param = action.FlowMId & (int)StartParam.EtalonMask;
if (action.IsDivUsed)
param |= (int)StartParam.DiverterStart;
if (action.IsSyncMethod)
param |= (int)StartParam.SynchroMethod;
else
param |= (int)StartParam.StartStopMethod;
if (action.IsDivUsed) param |= (int)StartParam.DiverterStart;
if (action.IsSyncMethod) param |= (int)StartParam.SynchroMethod;
if (action.IsStartStop) param |= (int)StartParam.StartStopMethod;
return (byte)param;
}
static byte GetStopParams(Action action)
{
int param = 0;
return (byte)param;
return (byte)0xFF;
}
}