Schematic drawing with live function, bench control by mouse, Dijkstra algo, vacuum, etc.
This commit is contained in:
@@ -12,6 +12,7 @@ using Dirichlet.Numerics;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.BenchControl.GenericDevices;
|
||||
using TBF.BenchControl.Modbus;
|
||||
using TBF.BenchControl.Sequences;
|
||||
|
||||
namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
{
|
||||
@@ -70,6 +71,19 @@ namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
}
|
||||
}
|
||||
|
||||
TBF.UiBridge.Bridge.RouteChangeHandler += delegate(object sndr, TBF.UiBridge.RouteChangeArgs args)
|
||||
{
|
||||
UInt128 mask = ((UInt128)1) << args.BitNr;
|
||||
if ((benchModelRoute & mask) == 0)
|
||||
{
|
||||
benchModelRoute |= mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
benchModelRoute &= (~mask);
|
||||
}
|
||||
};
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
@@ -114,6 +128,32 @@ namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
{
|
||||
SetOutputs((UInt32)(benchModelRoute & 0xFFFFFFFF));
|
||||
}
|
||||
|
||||
///
|
||||
/// Collect measured values
|
||||
///
|
||||
if (ProcessData.MeasuredValues == null || ProcessData.Setpoints.Length != ProcessData.ComponentsWithMeasuredVal.Count)
|
||||
{
|
||||
ProcessData.MeasuredValues = new double[ProcessData.ComponentsWithMeasuredVal.Count];
|
||||
}
|
||||
for (int i = 0; i < ProcessData.ComponentsWithMeasuredVal.Count; i++)
|
||||
{
|
||||
ProcessData.MeasuredValues[i] = ProcessData.ComponentsWithMeasuredVal[i].MeasuredVal;
|
||||
}
|
||||
|
||||
///
|
||||
/// Collect setpoints
|
||||
///
|
||||
if (ProcessData.Setpoints == null || ProcessData.Setpoints.Length != ProcessData.ComponentsWithSetpoint.Count)
|
||||
{
|
||||
ProcessData.Setpoints = new double[ProcessData.ComponentsWithSetpoint.Count];
|
||||
}
|
||||
for (int i = 0; i < ProcessData.ComponentsWithSetpoint.Count; i++)
|
||||
{
|
||||
ProcessData.Setpoints[i] = ProcessData.ComponentsWithSetpoint[i].SetpointVal;
|
||||
}
|
||||
|
||||
TBF.UiBridge.Bridge.OnStateMachineTick(this, new TBF.UiBridge.StateMachineTickEventArgs(benchModelRoute, ProcessData.MeasuredValues, ProcessData.Setpoints));
|
||||
}
|
||||
|
||||
public void StopDevice()
|
||||
@@ -124,6 +164,7 @@ namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
public void StopDevice2() { }
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Set outputs of QuidoRS board
|
||||
/// </summary>
|
||||
|
||||
@@ -5,6 +5,7 @@ using System;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
{
|
||||
@@ -35,9 +36,9 @@ namespace TBF.BenchControl.ControlBoard.Papouch
|
||||
parent = ParentForm as ComponentParametersDlg;
|
||||
if (parent == null) return;
|
||||
|
||||
if (parent.TbfComponents != null)
|
||||
if (parent.CmpntEntities != null)
|
||||
{
|
||||
foreach (var cmpnt in parent.TbfComponents)
|
||||
foreach (var cmpnt in parent.CmpntEntities)
|
||||
{
|
||||
if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is Modbus.Common.Factory)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user