diff --git a/TBF/Properties/AssemblyInfo.cs b/TBF/Properties/AssemblyInfo.cs index 5e23762d7..98978844d 100644 --- a/TBF/Properties/AssemblyInfo.cs +++ b/TBF/Properties/AssemblyInfo.cs @@ -29,5 +29,5 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("3.1.1638.0")] -[assembly: AssemblyFileVersion("3.1.1638.0")] +[assembly: AssemblyVersion("3.1.1639.0")] +[assembly: AssemblyFileVersion("3.1.1639.0")] diff --git a/TBF/Rig/ControlBoard/Uni/UniCB.cs b/TBF/Rig/ControlBoard/Uni/UniCB.cs index a10e01f70..f4b72f836 100644 --- a/TBF/Rig/ControlBoard/Uni/UniCB.cs +++ b/TBF/Rig/ControlBoard/Uni/UniCB.cs @@ -123,7 +123,8 @@ namespace TBF.Rig.ControlBoard.Uni /// Route: 128-bit word representing the current state of all valves and pumps /// public UInt128 Route { get { return benchModelRoute; } } - + public UInt128 RRoute { get { return (UInt128)Data.Vystupy; } } + /// Values valid during a test public double RefFrequency { get { return Data.ReferenceFreq[0]; } } public double RefFrequency1 { get { return Data.ReferenceFreq[1]; } } @@ -328,6 +329,21 @@ namespace TBF.Rig.ControlBoard.Uni rcvdData[i - lastValidOffset] = rcvdData[i]; } rcvdBytesCount -= lastValidOffset; + + /// Synchronize benchModelRoute with RRoute + SyncRoute(); + } + + /// + /// Set Route to value returned by RRoute. Take virtual valves into account. + /// + /// 'ulong' with bits of valves that have changed set to '1' + public UInt128 SyncRoute() + { + UInt128 oldRoute = benchModelRoute; + benchModelRoute = (RRoute & routeMask) | (benchModelRoute & (~routeMask)); + log.DebugFormat("SyncRoute(), new route = {0}", Utils.RouteToStr(benchModelRoute)); + return oldRoute ^ benchModelRoute; } /// @@ -359,7 +375,7 @@ namespace TBF.Rig.ControlBoard.Uni } } - if (!outputsInitialized || Data.Vystupy != (ulong)benchModelRoute || (StateMachine.Time - lastStateMachineTime) >= 15) + if (!outputsInitialized || RRoute != benchModelRoute || (StateMachine.Time - lastStateMachineTime) >= 15) { var actionsToModify = actionQueue.Where(x => (x.ActionId == ActionID.ChangeRoute)); bool oneModified = false;