Schematic drawing with live function, bench control by mouse, Dijkstra algo, vacuum, etc.
This commit is contained in:
@@ -4,17 +4,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using SchematicDrawing;
|
||||
using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
{
|
||||
public class FlowMeter : ComponentBase, GenericDevices.IFlowMeter, SchematicDrawing.IDrawingItemCmpnt
|
||||
public class FlowMeter : ComponentBase, GenericDevices.IFlowMeter, IDrawingItCmpnt
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(FlowMeter));
|
||||
public override string ToString() { return string.Format("FlowMeter({0})", Cfg.ToString(1)); }
|
||||
|
||||
readonly FlowMeterCfg flowMeterCfg;
|
||||
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return flowMeterCfg as SchematicDrawing.IDrawingItemCfg; } }
|
||||
public IDrawingItem DrawingItem { get { return flowMeterCfg as IDrawingItem; } }
|
||||
|
||||
public double NominalFlow { get { return flowMeterCfg.NominalFlow; } }
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml.Serialization;
|
||||
using SchematicDrawing;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
{
|
||||
public class FlowMeterCfg : ComponentCfgBase, IComponentCfg, SchematicDrawing.IDrawingItemCfg
|
||||
public class FlowMeterCfg : ComponentCfgBase, IComponentCfg, IDrawingItem
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -21,41 +22,41 @@ namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
///
|
||||
public float NominalFlow; /// Nominal flow in m3/h at output frequency 2000 Hz
|
||||
|
||||
public SchematicDrawing.Shape Shape { get; set; }
|
||||
public Shape Shape { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public SchematicDrawing.Sz Sz { get; set; }
|
||||
public SchematicDrawing.Orient Orient { get; set; }
|
||||
public Sz Sz { get; set; }
|
||||
public Orient Orient { get; set; }
|
||||
public bool Flip { get; set; }
|
||||
public int LblX { get; set; }
|
||||
public int LblY { get; set; }
|
||||
public SchematicDrawing.Orient LblOrient { get; set; }
|
||||
public int ValX { get; set; }
|
||||
public int ValY { get; set; }
|
||||
public double ValFact { get; set; }
|
||||
public string ValFmt { get; set; }
|
||||
public SchematicDrawing.Orient ValOrient { get; set; }
|
||||
public Orient LblOrient { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
FlowMeterCfg()
|
||||
{
|
||||
}
|
||||
GNodes = new List<GNode>();
|
||||
}
|
||||
|
||||
public FlowMeterCfg(string name, IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
Shape = Shape.FlowM;
|
||||
Sz = Sz.M;
|
||||
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
NominalFlow = 1.0f;
|
||||
Shape = SchematicDrawing.Shape.FlowM;
|
||||
}
|
||||
|
||||
public bool IsHidden() { return (X == 0) && (Y == 0); }
|
||||
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, NominalFlow={1}", Name, NominalFlow);
|
||||
return string.Format("{0} {1}[{2},{3}] NominalFlow={4}", Name, Shape, X, Y, NominalFlow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using System;
|
||||
using System.Windows.Forms;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
using TBF.UI.Bench.Components;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
{
|
||||
|
||||
@@ -8,13 +8,13 @@ using TBF.Boxes;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.RegulValve
|
||||
{
|
||||
public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegulValve, SchematicDrawing.IDrawingItemCmpnt
|
||||
public class RegulValve : ComponentBase, IDevice, GenericDevices.IRegulValve, SchematicDrawing.IDrawingItCmpnt
|
||||
{
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(RegulValve));
|
||||
public override string ToString() { return string.Format("RegulValve({0})", Cfg.ToString(1)); }
|
||||
|
||||
public readonly RegulValveCfg RegulValveCfg;
|
||||
public SchematicDrawing.IDrawingItemCfg DrawingItemCfg { get { return RegulValveCfg as SchematicDrawing.IDrawingItemCfg; } }
|
||||
public SchematicDrawing.IDrawingItem DrawingItem { get { return RegulValveCfg as SchematicDrawing.IDrawingItem; } }
|
||||
|
||||
public ValveCategory Category { get { return RegulValveCfg.Category; } }
|
||||
///
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
///
|
||||
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
|
||||
///
|
||||
using TBF.BenchControl.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using SchematicDrawing;
|
||||
using TBF.BenchControl.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.RegulValve
|
||||
{
|
||||
public class RegulValveCfg : ComponentCfgBase, IComponentCfg, SchematicDrawing.IDrawingItemCfg
|
||||
public class RegulValveCfg : ComponentCfgBase, IComponentCfg, IDrawingItem
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegulValveCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
@@ -18,25 +20,24 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
///
|
||||
public ValveCategory Category; /// Feeding, Output or All
|
||||
|
||||
public SchematicDrawing.Shape Shape { get; set; }
|
||||
public Shape Shape { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public SchematicDrawing.Sz Sz { get; set; }
|
||||
public SchematicDrawing.Orient Orient { get; set; }
|
||||
public Sz Sz { get; set; }
|
||||
public Orient Orient { get; set; }
|
||||
public bool Flip { get; set; }
|
||||
public int LblX { get; set; }
|
||||
public int LblY { get; set; }
|
||||
public SchematicDrawing.Orient LblOrient { get; set; }
|
||||
public int ValX { get; set; }
|
||||
public int ValY { get; set; }
|
||||
public double ValFact { get; set; }
|
||||
public string ValFmt { get; set; }
|
||||
public SchematicDrawing.Orient ValOrient { get; set; }
|
||||
public Orient LblOrient { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<GNode> GNodes { get; set; }
|
||||
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
RegulValveCfg()
|
||||
{
|
||||
GNodes = new List<GNode>();
|
||||
}
|
||||
|
||||
public RegulValveCfg(string name, IComponentFactory factory)
|
||||
@@ -45,14 +46,15 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
Name = name;
|
||||
Factory = factory;
|
||||
Category = ValveCategory.Output;
|
||||
Shape = SchematicDrawing.Shape.RegV;
|
||||
Shape = Shape.RegV;
|
||||
Sz = Sz.M;
|
||||
}
|
||||
|
||||
public bool IsHidden() { return (X == 0) && (Y == 0); }
|
||||
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}", Name);
|
||||
return string.Format("{0} {1}[{2},{3}]", Name, Shape, X, Y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.Dummy.RegulValve
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user